本文整理匯總了C#中OpenMetaverse.Quaternion.Normalize方法的典型用法代碼示例。如果您正苦於以下問題:C# Quaternion.Normalize方法的具體用法?C# Quaternion.Normalize怎麽用?C# Quaternion.Normalize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenMetaverse.Quaternion
的用法示例。
在下文中一共展示了Quaternion.Normalize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: rotate
/// <summary>
/// rotate the specified amounts around the camera's local axis
/// </summary>
/// <param name="X"></param>
/// <param name="Y"></param>
/// <param name="Z"></param>
public void rotate(float X, float Y, float Z)
{
if (YawFixed) {
// some of the rotation is around X
OMV.Quaternion xvec = OMV.Quaternion.CreateFromAxisAngle(OMV.Vector3.UnitX, X);
xvec.Normalize();
// some of the rotation is around Z
OMV.Quaternion zvec = OMV.Quaternion.CreateFromAxisAngle(OMV.Vector3.UnitZ, Z);
zvec.Normalize();
m_heading = zvec * m_heading;
m_heading = m_heading * xvec;
}
else {
OMV.Quaternion rot = new OMV.Quaternion(X, Y, Z);
rot.Normalize();
rotate(rot);
}
}
示例2: rotate
/// <summary>
/// rotate the specified amounts around the camera's local axis
/// </summary>
/// <param name="X"></param>
/// <param name="Y"></param>
/// <param name="Z"></param>
public void rotate(float X, float Y, float Z)
{
if (YawFixed) {
// some of the rotation is around local X
OMV.Quaternion xvec = OMV.Quaternion.CreateFromAxisAngle(OMV.Vector3.UnitY, -X);
// some of the rotation is around Z
OMV.Quaternion zvec = OMV.Quaternion.CreateFromAxisAngle(OMV.Vector3.UnitZ, Z);
// m_heading = m_heading * xvec;
m_heading = xvec * m_heading * zvec;
// LogManager.Log.Log(LogLevel.DVIEWDETAIL, "CameraControl.rotate: xv={0}, zv={1}, h={2}",
// xvec, zvec, m_heading);
}
else {
OMV.Quaternion rot = new OMV.Quaternion(X, Y, Z);
rot.Normalize();
rotate(rot);
}
if (OnCameraUpdate != null) OnCameraUpdate(this);
}