AR轨迹逻辑

This commit is contained in:
lishuo committed 2022-10-08 13:26:38 +08:00
1 parent 195893a1b0
commit d1c84d0a8a
30 files changed
+159988 -4149

No files matched your search

@@ -8,6 +8,7 @@
using UnityEngine;
using System.Collections;
using FluffyUnderware.DevTools;
using DG.Tweening;
namespace FluffyUnderware.Curvy.Examples
{
@@ -18,12 +19,15 @@ namespace FluffyUnderware.Curvy.Examples
public Transform MoveTo;
public Transform RollTo;
[Positive]
public float ChaseTime=0.1f;
public float ChaseTime=0.5f;
Vector3 mVelocity;
Vector3 mRollVelocity;
private void Start()
{
}
#if UNITY_EDITOR
void Update()
{
@@ -37,7 +41,7 @@ namespace FluffyUnderware.Curvy.Examples
// else transform.LookAt(LookAt, RollTo.up);
//}
if (RollTo)
transform.rotation = Quaternion.Euler(new Vector3(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, RollTo.rotation.eulerAngles.z));
transform.rotation = Quaternion.LookRotation(new Vector3(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, RollTo.rotation.eulerAngles.z));
}
}
#endif
@@ -52,8 +56,8 @@ namespace FluffyUnderware.Curvy.Examples
// if (!RollTo) transform.LookAt(LookAt);
// else transform.LookAt(LookAt, Vector3.SmoothDamp(transform.up, RollTo.up, ref mRollVelocity, ChaseTime));
//}
// if (RollTo)
// transform.rotation = Quaternion.Euler (new Vector3 (transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, RollTo.rotation.eulerAngles.z));
if (RollTo)
transform.rotation = Quaternion.LookRotation(new Vector3(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, RollTo.rotation.eulerAngles.z));
}
}
}