Пример #1
0
        public static XMVector Normalize(XMVector v)
        {
            XMVector result = XMVector4.Length(v);
            float    length = result.X;

            // Prevent divide by zero
            if (length > 0)
            {
                length = 1.0f / length;
            }

            return(new XMVector(
                       v.X * length,
                       v.Y * length,
                       v.Z * length,
                       v.W * length));
        }
Пример #2
0
 public static XMVector Length(XMVector q)
 {
     return(XMVector4.Length(q));
 }