Explorar el Código

set controller's deviceRotationQuaternion even when there is no mesh set

Trevor Baron hace 7 años
padre
commit
9287a1388f
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      src/Gamepad/Controllers/babylon.poseEnabledController.ts

+ 3 - 2
src/Gamepad/Controllers/babylon.poseEnabledController.ts

@@ -88,12 +88,13 @@ module BABYLON {
             Vector3.TransformCoordinatesToRef(this._calculatedPosition, this._deviceToWorld, this.devicePosition)
             Vector3.TransformCoordinatesToRef(this._calculatedPosition, this._deviceToWorld, this.devicePosition)
             this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix);
             this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix);
             Quaternion.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion);
             Quaternion.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion);
-
+            this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation)
+            
             if (this._mesh) {
             if (this._mesh) {
                 this._mesh.position.copyFrom(this.devicePosition);
                 this._mesh.position.copyFrom(this.devicePosition);
 
 
                 if (this._mesh.rotationQuaternion) {
                 if (this._mesh.rotationQuaternion) {
-                    this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation));
+                    this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion);
                 }
                 }
             }
             }
         }
         }