Skip to content

Conversation

NSTCG
Copy link
Collaborator

@NSTCG NSTCG commented Jul 19, 2024

No description provided.

Comment on lines -64 to +68
canvas.removeEventListener('mousedown', this.requestPointerLock);
canvas.removeEventListener('pointerdown', this.onPointerDown);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pointerlock only really makes sense in a mouse on desktop context, though, right? Then having touch input request pointer lock isn't really desired.

Copy link
Collaborator Author

@NSTCG NSTCG Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Squareys How do you suggest we filter it out on mobile devies ? maybe a isMobile check ?

mouse-look.ts Outdated
Comment on lines 107 to 109
setTimeout(() => {
this.pointerLockCooldown = false;
}, 1500);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of the cooldown and why is it 1500 ms? 🤔

Copy link
Collaborator Author

@NSTCG NSTCG Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refer line 43

@@ -38,71 +40,115 @@ export class MouseLookComponent extends Component {
private rotationX = 0;
private rotationY = 0;
private mouseDown = false;
/** Pointerlock spec prevents calling pointerlock right after user exiting it via esc for ~1 second */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a link for that? Better would be to know the exact moment a next pointer lock is possible. I would bet it's after flushing the task queue, rather than a delay?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidPeicho I learned about it in a quora discussion , was not able to find its official documentation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants