Skip to content

Add pointers for mouse look component , Improve pointer lock. #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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? 🤔

@@ -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