四元数是一个乱七八糟得到东西还没搞懂搞懂后再补 先添加unity API
transform.rotation 是Quaternionlei类并非Vector3向量 不能进行直接转化
那如何将Vector3转换呢?
Quaternion.loadrotation(Vector3);
{
Vector3 relativePos = target.position – transform.position;
transform.rotation = Quaternion.LookRotation(relativePos);
}
transform.localEurlerAngle=Vector3 (获取欧拉角)
Quaternion.AngleAxis(float,Vector3);
void Example() {
transform.rotation = Quaternion.AngleAxis(30, Vector3.up);
}