本文整理汇总了C#中FarseerPhysics.Collision.Shapes.EdgeShape.RayCast方法的典型用法代码示例。如果您正苦于以下问题:C# EdgeShape.RayCast方法的具体用法?C# EdgeShape.RayCast怎么用?C# EdgeShape.RayCast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FarseerPhysics.Collision.Shapes.EdgeShape
的用法示例。
在下文中一共展示了EdgeShape.RayCast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RayCast
/// <summary>
/// Cast a ray against a child shape.
/// </summary>
/// <param name="output">The ray-cast results.</param>
/// <param name="input">The ray-cast input parameters.</param>
/// <param name="transform">The transform to be applied to the shape.</param>
/// <param name="childIndex">The child shape index.</param>
/// <returns>True if the ray-cast hits the shape</returns>
public override bool RayCast(out RayCastOutput output, ref RayCastInput input,
ref Transform transform, int childIndex)
{
Debug.Assert(childIndex < Vertices.Count);
EdgeShape edgeShape = new EdgeShape();
int i1 = childIndex;
int i2 = childIndex + 1;
if (i2 == Vertices.Count)
{
i2 = 0;
}
edgeShape.Vertex1 = Vertices[i1];
edgeShape.Vertex2 = Vertices[i2];
return edgeShape.RayCast(out output, ref input, ref transform, 0);
}