本文整理匯總了C#中UnityEngine.Quaternion.Convert方法的典型用法代碼示例。如果您正苦於以下問題:C# Quaternion.Convert方法的具體用法?C# Quaternion.Convert怎麽用?C# Quaternion.Convert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEngine.Quaternion
的用法示例。
在下文中一共展示了Quaternion.Convert方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawRays2
/// <summary>
/// Using Unity Debug, draws the x,y,z axis of a Quaternion as x magenta, y yellow and z cyan
/// </summary>
/// <param name="rot">The OpenTK Quaterion</param>
/// <param name="pos">The UnityEngine Vector3 position to be drawn</param>
/// <param name="scale">The float length of the axis in meter</param>
public static void DrawRays2(Quaternion rot, Vector3 pos, float scale)
{
OpenTK.Vector3 right = OpenTK.Vector3.Transform(OpenTK.Vector3.UnitX, rot.Convert());
OpenTK.Vector3 up = OpenTK.Vector3.Transform(OpenTK.Vector3.UnitY, rot.Convert());
OpenTK.Vector3 forward = OpenTK.Vector3.Transform(OpenTK.Vector3.UnitZ, rot.Convert());
Debug.DrawRay(pos, right.Convert() * scale, Color.magenta);
Debug.DrawRay(pos, up.Convert() * scale, Color.yellow);
Debug.DrawRay(pos, forward.Convert() * scale, Color.cyan);
}