Hi. I’m currently creating a custom camera input.
It can be moved with the WASD keys, and the viewpoint can be rotated by dragging the mouse.
Since this input class itself does not interact with the DOM, it has the advantage of being usable inside a Web Worker as well.
However, while it works correctly when only moving with WASD, there are some bugs when moving while changing the view with the mouse. For example, even though I’m pressing W, the camera may move sideways instead of forward, or when pressing W and D at the same time, the movement speed becomes faster only in the sideways direction.
Please feel free to try it in the playground:
https://playground.babylonjs.com/#9H2V2O
Is there something wrong with my calculations?
I would appreciate any advice.
Thanks!