本文整理汇总了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);
}