Add pointers for mouse look component , Improve pointer lock.#64
Add pointers for mouse look component , Improve pointer lock.#64NSTCG wants to merge 2 commits intoWonderlandEngine:mainfrom
Conversation
| canvas.removeEventListener('mousedown', this.requestPointerLock); | ||
| canvas.removeEventListener('pointerdown', this.onPointerDown); |
There was a problem hiding this comment.
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.
@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.
What is the purpose of the cooldown and why is it 1500 ms? 🤔
| 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.
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.
@DavidPeicho I learned about it in a quora discussion , was not able to find its official documentation.
There was a problem hiding this comment.
No description provided.