示例#1
0
    public static m_Quaternion GetCopyFromQuaternion(Quaternion q)
    {
        m_Quaternion res = new m_Quaternion();

        res.x = q.x;
        res.y = q.y;
        res.z = q.z;
        res.w = q.w;

        return(res);
    }
示例#2
0
    static public m_Quaternion AngleAxis(float angle, Vector3 axis)
    {
        m_Quaternion rot = new m_Quaternion();

        rot.w = Mathf.Cos(angle * 0.5f * Mathf.Deg2Rad);
        float _sin = Mathf.Sin(angle * 0.5f * Mathf.Deg2Rad);

        rot.x = _sin * axis.x;
        rot.y = _sin * axis.y;
        rot.z = _sin * axis.z;

        return(rot);
    }
示例#3
0
 public void SetRotate(m_Quaternion rot)
 {
     q            = rot;
     dirty        = true;
     inverseDirty = true;
 }