public static XMVector RotationNormal(XMVector normalAxis, float angle) { XMVector n = XMVector.Select(XMGlobalConstants.One, normalAxis, XMGlobalConstants.Select1110); float sinV; float cosV; XMScalar.SinCos(out sinV, out cosV, 0.5f * angle); XMVector scale = new XMVector(sinV, sinV, sinV, cosV); return(XMVector.Multiply(n, scale)); }
public static void ToAxisAngle(out XMVector axis, out float angle, XMVector q) { axis = q; angle = 2.0f * XMScalar.ACos(q.W); }