本文整理汇总了C#中BulletXNA.LinearMath.IndexedQuaternion.LengthSquared方法的典型用法代码示例。如果您正苦于以下问题:C# IndexedQuaternion.LengthSquared方法的具体用法?C# IndexedQuaternion.LengthSquared怎么用?C# IndexedQuaternion.LengthSquared使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BulletXNA.LinearMath.IndexedQuaternion
的用法示例。
在下文中一共展示了IndexedQuaternion.LengthSquared方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IndexedBasisMatrix
public IndexedBasisMatrix(ref IndexedQuaternion q)
{
float d = q.LengthSquared();
Debug.Assert(d != 0.0f);
float s = 2.0f / d;
float xs = q.X * s, ys = q.Y * s, zs = q.Z * s;
float wx = q.W * xs, wy = q.W * ys, wz = q.W * zs;
float xx = q.X * xs, xy = q.X * ys, xz = q.X * zs;
float yy = q.Y * ys, yz = q.Y * zs, zz = q.Z * zs;
_el0 = new IndexedVector3(1.0f - (yy + zz), xy - wz, xz + wy);
_el1 = new IndexedVector3(xy + wz, 1.0f - (xx + zz), yz - wx);
_el2 = new IndexedVector3(xz - wy, yz + wx, 1.0f - (xx + yy));
}
示例2: SetRotation
public void SetRotation(ref IndexedQuaternion q)
{
float d = q.LengthSquared();
Debug.Assert(d != 0.0f);
float s = 2.0f / d;
float xs = q.X * s, ys = q.Y * s, zs = q.Z * s;
float wx = q.W * xs, wy = q.W * ys, wz = q.W * zs;
float xx = q.X * xs, xy = q.X * ys, xz = q.X * zs;
float yy = q.Y * ys, yz = q.Y * zs, zz = q.Z * zs;
SetValue(1.0f - (yy + zz), xy - wz, xz + wy,
xy + wz, 1.0f - (xx + zz), yz - wx,
xz - wy, yz + wx, 1.0f - (xx + yy));
}