|
@@ -324,14 +324,7 @@ export class TargetCamera extends Camera {
|
|
this.rotation.x += this.cameraRotation.x * directionMultiplier;
|
|
this.rotation.x += this.cameraRotation.x * directionMultiplier;
|
|
this.rotation.y += this.cameraRotation.y * directionMultiplier;
|
|
this.rotation.y += this.cameraRotation.y * directionMultiplier;
|
|
|
|
|
|
- //rotate, if quaternion is set and rotation was used
|
|
|
|
- if (this.rotationQuaternion) {
|
|
|
|
- var len = this.rotation.lengthSquared();
|
|
|
|
- if (len) {
|
|
|
|
- Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ // Apply constraints
|
|
if (!this.noRotationConstraint) {
|
|
if (!this.noRotationConstraint) {
|
|
var limit = 1.570796;
|
|
var limit = 1.570796;
|
|
|
|
|
|
@@ -342,6 +335,14 @@ export class TargetCamera extends Camera {
|
|
this.rotation.x = -limit;
|
|
this.rotation.x = -limit;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //rotate, if quaternion is set and rotation was used
|
|
|
|
+ if (this.rotationQuaternion) {
|
|
|
|
+ var len = this.rotation.lengthSquared();
|
|
|
|
+ if (len) {
|
|
|
|
+ Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// Inertia
|
|
// Inertia
|