Browse Source

Merge pull request #9036 from PolygonalSun/user/polygonalsun/mouse-to-pointer

User/polygonalsun/mouse to pointer
David Catuhe 4 years ago
parent
commit
40638a1d3b
1 changed files with 5 additions and 0 deletions
  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 {