David Catuhe 6 年 前
コミット
7b0f673076

+ 1 - 1
src/Cameras/VR/webVRCamera.ts

@@ -463,7 +463,7 @@ export class WebVRFreeCamera extends FreeCamera implements PoseControlled {
      * @param poseData Pose coming from the device
      */
     updateFromDevice(poseData: DevicePose) {
-        if (poseData && poseData.orientation) {
+        if (poseData && poseData.orientation && poseData.orientation.length === 4) {
             this.rawPose = poseData;
             this._deviceRoomRotationQuaternion.copyFromFloats(poseData.orientation[0], poseData.orientation[1], -poseData.orientation[2], -poseData.orientation[3]);
 

+ 1 - 1
src/Gamepads/Controllers/poseEnabledController.ts

@@ -309,7 +309,7 @@ export class PoseEnabledController extends Gamepad implements PoseControlled {
                 this._calculatedPosition.addInPlace(this.position);
             }
             let pose = this.rawPose;
-            if (poseData.orientation && pose.orientation) {
+            if (poseData.orientation && pose.orientation && pose.orientation.length === 4) {
                 this._deviceRoomRotationQuaternion.copyFromFloats(pose.orientation[0], pose.orientation[1], -pose.orientation[2], -pose.orientation[3]);
                 if (this._mesh) {
                     if (this._mesh.getScene().useRightHandedSystem) {