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)); }
public static XMVector Length(XMVector q) { return(XMVector4.Length(q)); }