소스 검색

add option to keep up verctor for camera

David Catuhe 5 년 전
부모
커밋
2c0c74d800
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/Cameras/targetCamera.ts

+ 3 - 1
src/Cameras/targetCamera.ts

@@ -434,7 +434,9 @@ export class TargetCamera extends Camera {
                 const parentWorldMatrix = this.parent.getWorldMatrix();
                 Vector3.TransformCoordinatesToRef(position, parentWorldMatrix, this._globalPosition);
                 Vector3.TransformCoordinatesToRef(target, parentWorldMatrix, this._tmpTargetVector);
-                Vector3.TransformNormalToRef(up, parentWorldMatrix, this._tmpUpVector);
+                if (this.updateUpVectorFromRotation) {
+                    Vector3.TransformNormalToRef(up, parentWorldMatrix, this._tmpUpVector);
+                }
                 this._markSyncedWithParent();
             } else {
                 this._globalPosition.copyFrom(position);