Explorar el Código

Additional check for Free Camera

Dave Solares hace 4 años
padre
commit
36e727a4a7
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/Cameras/Inputs/freeCameraMouseInput.ts

+ 5 - 0
src/Cameras/Inputs/freeCameraMouseInput.ts

@@ -94,6 +94,11 @@ export class FreeCameraMouseInput implements ICameraInput<FreeCamera> {
                         evt.preventDefault();
                         element.focus();
                     }
+
+                    // This is required to move while pointer button is down
+                    if (engine.isPointerLock && this._onMouseMove) {
+                        this._onMouseMove(p.event);
+                    }
                 }
                 else if (p.type === PointerEventTypes.POINTERUP && srcElement) {
                     try {