本文整理汇总了C#中XMVector.Negate方法的典型用法代码示例。如果您正苦于以下问题:C# XMVector.Negate方法的具体用法?C# XMVector.Negate怎么用?C# XMVector.Negate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMVector
的用法示例。
在下文中一共展示了XMVector.Negate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SquadSetup
public static void SquadSetup(out XMVector a, out XMVector b, out XMVector c, XMVector q0, XMVector q1, XMVector q2, XMVector q3)
{
XMVector ls12 = XMQuaternion.LengthSquare(XMVector.Add(q1, q2));
XMVector ld12 = XMQuaternion.LengthSquare(XMVector.Subtract(q1, q2));
XMVector sq2 = q2.Negate();
XMVector control1 = XMVector.Less(ls12, ld12);
sq2 = XMVector.Select(q2, sq2, control1);
XMVector ls01 = XMQuaternion.LengthSquare(XMVector.Add(q0, q1));
XMVector ld01 = XMQuaternion.LengthSquare(XMVector.Subtract(q0, q1));
XMVector sq0 = q0.Negate();
XMVector ls23 = XMQuaternion.LengthSquare(XMVector.Add(sq2, q3));
XMVector ld23 = XMQuaternion.LengthSquare(XMVector.Subtract(sq2, q3));
XMVector sq3 = q3.Negate();
XMVector control0 = XMVector.Less(ls01, ld01);
XMVector control2 = XMVector.Less(ls23, ld23);
sq0 = XMVector.Select(q0, sq0, control0);
sq3 = XMVector.Select(q3, sq3, control2);
XMVector invQ1 = XMQuaternion.Inverse(q1);
XMVector invQ2 = XMQuaternion.Inverse(sq2);
XMVector ln_q0 = XMQuaternion.Ln(XMQuaternion.Multiply(invQ1, sq0));
XMVector ln_q2 = XMQuaternion.Ln(XMQuaternion.Multiply(invQ1, sq2));
XMVector ln_q1 = XMQuaternion.Ln(XMQuaternion.Multiply(invQ2, q1));
XMVector ln_q3 = XMQuaternion.Ln(XMQuaternion.Multiply(invQ2, sq3));
XMVector negativeOneQuarter = XMVector.FromSplatConstant(-1, 2);
XMVector expQ02 = XMVector.Multiply(XMVector.Add(ln_q0, ln_q2), negativeOneQuarter);
XMVector expQ13 = XMVector.Multiply(XMVector.Add(ln_q1, ln_q3), negativeOneQuarter);
expQ02 = XMQuaternion.Exp(expQ02);
expQ13 = XMQuaternion.Exp(expQ13);
a = XMQuaternion.Multiply(q1, expQ02);
b = XMQuaternion.Multiply(sq2, expQ13);
c = sq2;
}