I noticed when moving the camera diagonally, the actual speed velocity is much faster, the combined input vectors should be normalized?
Example playground: https://playground.babylonjs.com/#EDTBVQ
I think here it needs to be normalized when more keys are pressed, but I don’t really understand.
this._onKeyboardObserver = null;
this._onCanvasBlurObserver = null;
}
this._keys.length = 0;
}
/**
* Update the current camera state depending on the inputs that have been used this frame.
* This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
*/
public checkInputs(): void {
if (this._onKeyboardObserver) {
const camera = this.camera;
// Movement keys are gated on the keyboard→translate mapping and rotation keys on
// keyboard→rotate. Removing the corresponding entry disables that family of keys.
// An entry's optional `sensitivity` acts as a gain (default 1) over the legacy scaling.
const input = camera.movement.input;
const translateEntry = input.getEntry("keyboard", "translate");
const rotateEntry = input.getEntry("keyboard", "rotate");
const rotateGain = rotateEntry?.sensitivity ?? 1;
// Keyboard