使用四元数点乘比较插值是否即将完成

 

在四元数插值时,准确比较插值是否完成或者即将完成,可以使用四元数点乘的接口

最后点乘结果会不断接近-1或1。具体根据转向而定

 

脚本:

transform.rotation = Quaternion.Lerp(transform.rotation, targetRot.rotation, 0.1f);
var dot = Quaternion.Dot(transform.rotation, targetRot.rotation);
Debug.Log("dot: " + dot);

 

相关文章:

  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2021-09-08
  • 2022-01-03
  • 2022-12-23
相关资源
相似解决方案