本文整理汇总了C#中BulletXNA.LinearMath.IndexedQuaternion.Normalize方法的典型用法代码示例。如果您正苦于以下问题:C# IndexedQuaternion.Normalize方法的具体用法?C# IndexedQuaternion.Normalize怎么用?C# IndexedQuaternion.Normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BulletXNA.LinearMath.IndexedQuaternion
的用法示例。
在下文中一共展示了IndexedQuaternion.Normalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateCamera
//----------------------------------------------------------------------------------------------
public virtual void UpdateCamera()
{
float rele = m_pitch;
float razi = m_yaw;
IndexedQuaternion rot = new IndexedQuaternion(m_cameraUp, razi);
IndexedVector3 eyePos = new IndexedVector3();
eyePos[m_forwardAxis] = m_cameraDistance;
IndexedVector3 forward = eyePos;
if (forward.LengthSquared() < MathUtil.SIMD_EPSILON)
{
forward = new IndexedVector3(0,0,-1);
}
IndexedVector3 right = IndexedVector3.Cross(m_cameraUp, IndexedVector3.Normalize(forward));
IndexedQuaternion roll = new IndexedQuaternion(right, -rele);
rot.Normalize();
roll.Normalize();
IndexedMatrix m1 = IndexedMatrix.CreateFromQuaternion(rot);
IndexedMatrix m2 = IndexedMatrix.CreateFromQuaternion(roll);
IndexedMatrix m3 = m1 * m2;
//eyePos = new IndexedVector3(Vector3.Transform(eyePos.ToVector3(),(rot * roll)));
//eyePos = new IndexedVector3(eyePos, (rot * roll));
eyePos = m3 * eyePos;
//m_cameraTargetPosition = m_cameraPosition + eyePos;
m_cameraPosition = eyePos;
m_cameraPosition += m_cameraTargetPosition;
if (m_glutScreenWidth == 0 && m_glutScreenHeight == 0)
return;
m_lookAt = IndexedMatrix.CreateLookAt(m_cameraPosition, m_cameraTargetPosition, m_cameraUp);
Matrix t = Matrix.CreateLookAt(m_cameraPosition.ToVector3(), m_cameraTargetPosition.ToVector3(), m_cameraUp.ToVector3());
Matrix t2 = m_lookAt.ToMatrix();
if (t != t2)
{
int ibreak2 = 0;
}
int ibreak = 0;
}