示例#1
0
        public static SBSQuaternion AngleAxis(float angle, SBSVector3 axis)
        {
            angle *= (SBSMath.ToRadians * 0.5f);
            SBSVector3 a = axis.normalized;
            float      s = SBSMath.Sin(angle),
                       c = SBSMath.Cos(angle);

            return(new SBSQuaternion(a.x * s, a.y * s, a.z * s, c));
        }
示例#2
0
        public void SetAngleAxis(float angle, SBSVector3 axis)
        {
            angle *= (SBSMath.ToRadians * 0.5f);
            SBSVector3 a = axis.normalized;
            float      s = SBSMath.Sin(angle),
                       c = SBSMath.Cos(angle);

            x = a.x * s;
            y = a.y * s;
            z = a.z * s;
            w = c;
        }