瀏覽代碼

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);