Explorar o código

add option to keep up verctor for camera

David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
2c0c74d800
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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);