-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
Conversation
canvas.removeEventListener('mousedown', this.requestPointerLock); | ||
canvas.removeEventListener('pointerdown', this.onPointerDown); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
setTimeout(() => { | ||
this.pointerLockCooldown = false; | ||
}, 1500); |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.