Skip to content

Commit

Permalink
Fix Rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
MrApple100 committed Mar 12, 2024
1 parent 82b31d4 commit 1953d01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Assets/Scripts/CameraMover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void Activate(bool value, Vector3 offset)
_point.SetActive(value);
_point.transform.position -= offset;
Rotation = _point.transform.rotation;
Rotation = Quaternion.Euler(_point.transform.rotation.eulerAngles * -1);
}
}

Expand Down Expand Up @@ -165,9 +166,9 @@ private void Update()
_minDiff = diff.magnitude;
_worldCameraPoint.position += _velocity * Time.deltaTime;
float mult = (_maxDiff - _minDiff) / _maxDiff;
Debug.Log($"Mult: {mult}");
_world.rotation = Quaternion.Lerp(_prevRotation, _rotation, RotationFunc(mult));

//TODO: PIDCONTROLLER
xPosController.updateSetpoint(_worldCameraPoint.position.x);
yPosController.updateSetpoint(_worldCameraPoint.position.y);
zPosController.updateSetpoint(_worldCameraPoint.position.z);
Expand Down

0 comments on commit 1953d01

Please sign in to comment.