四元数.Lerp
静态四元数 Lerp(四元数 from, 四元数 to, float t);
描述: 在 from 和 to 之间按 t 进行插值,然后对结果进行归一化。 这比 Slerp 更快,但如果旋转相距较远,看起来会更糟。
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Transform from;
public Transform to;
public float speed = 0.1F;
void Update() {
transform.rotation = Quaternion.Lerp(from.rotation, to.rotation, Time.time * speed);
}
}
您能写下 libGDX 中的等效项吗?我尝试了很长时间但没有成功。
最佳答案
libGDX 有 slerp 方法:
slerp(四元数[] q) Spherical 对多个四元数进行线性插值,并将结果存储在该四元数中。
https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/Quaternion.html
关于java - Unity3D 四元数 libGDX 等效项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26765655/