当前位置: 首页>>代码示例>>C#>>正文


C# Vector3.Project方法代码示例

本文整理汇总了C#中UnityEngine.Vector3.Project方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.Project方法的具体用法?C# Vector3.Project怎么用?C# Vector3.Project使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Vector3的用法示例。


在下文中一共展示了Vector3.Project方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: distance

 /// <summary>
 /// Calculate the distance between two point's projections on a plane.
 /// </summary>
 /// <param name="v"></param>
 /// <param name="u"></param>
 /// <param name="planePos">An arbitrary point inside the plane.</param>
 /// <param name="planeRot">The plane's rotation.</param>
 /// <returns>The distance of both points' projection in the plane.</returns>
 public static float distance(this Vector3 v, Vector3 u, Vector3 planePos, Quaternion planeRot)
 {
     var localv = v.Project( planePos, planeRot );
     var localu = u.Project( planePos, planeRot );
     return localv.distance( localu );
 }
开发者ID:Elideb,项目名称:UnExt,代码行数:14,代码来源:VectorExtensions.cs

示例2: sqrDistance

 /// <summary>
 /// Calculate the squared distance between two points' projections on an arbitrary plane.
 /// </summary>
 /// <param name="v"></param>
 /// <param name="normal">Normal defining the plane to project on.</param>
 /// <returns>The squared distance between the two points on the plane.</returns>
 public static float sqrDistance(this Vector3 v, Vector3 u, Vector3 normal)
 {
     var localv = v.Project( normal );
     var localu = u.Project( normal );
     return localv.distance( localu );
 }
开发者ID:Elideb,项目名称:UnExt,代码行数:12,代码来源:VectorExtensions.cs


注:本文中的UnityEngine.Vector3.Project方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。