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