|
|
|
@ -104,13 +104,12 @@ namespace CameraRoll.Client.Tool {
|
|
|
|
|
_interpolationState += InterpolationSpeed;
|
|
|
|
|
|
|
|
|
|
Vector3 prevPos = GetPos(_pointIndex - 1);
|
|
|
|
|
Vector3 posDiff = GetPos(_pointIndex) - prevPos;
|
|
|
|
|
_cam.transform.position = prevPos + posDiff * _interpolationState;
|
|
|
|
|
Vector3 newPos = GetPos(_pointIndex);
|
|
|
|
|
_cam.transform.position = Vector3.Lerp(prevPos , newPos, _interpolationState);
|
|
|
|
|
|
|
|
|
|
Vector3 prevRot = GetRot(_pointIndex - 1);
|
|
|
|
|
Vector3 rotDiff = GetRot(_pointIndex) - prevRot;
|
|
|
|
|
_cam.transform.eulerAngles = prevRot + rotDiff * _interpolationState;
|
|
|
|
|
// TODO: interpolate across the shorter direction of rotation
|
|
|
|
|
Quaternion prevRot = GetRot(_pointIndex - 1);
|
|
|
|
|
Quaternion newRot = GetRot(_pointIndex);
|
|
|
|
|
_cam.transform.rotation = Quaternion.Slerp(prevRot, newRot, _interpolationState);
|
|
|
|
|
|
|
|
|
|
if (_interpolationState >= 1.0f) {
|
|
|
|
|
_pointIndex++;
|
|
|
|
@ -120,7 +119,7 @@ namespace CameraRoll.Client.Tool {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Vector3 GetPos(int index) => PathPoints[index].transform.position;
|
|
|
|
|
private static Vector3 GetRot(int index) => PathPoints[index].transform.eulerAngles;
|
|
|
|
|
private static Quaternion GetRot(int index) => PathPoints[index].transform.rotation;
|
|
|
|
|
|
|
|
|
|
public static void OnExit() {
|
|
|
|
|
Clear();
|
|
|
|
|