本文整理汇总了C#中LineSegment.IsCrossing方法的典型用法代码示例。如果您正苦于以下问题:C# LineSegment.IsCrossing方法的具体用法?C# LineSegment.IsCrossing怎么用?C# LineSegment.IsCrossing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LineSegment
的用法示例。
在下文中一共展示了LineSegment.IsCrossing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsInCollisionWith
/// <summary>
/// Says whether this triangle collides with the given triangle.
/// </summary>
/// <param name="triangle">The given triangle</param>
/// <returns>True if they are in collision</returns>
public bool IsInCollisionWith(Triangle triangle)
{
LineSegment ab1 = new LineSegment(A, B);
LineSegment ac1 = new LineSegment(A, C);
LineSegment bc1 = new LineSegment(B, C);
LineSegment ab2 = new LineSegment(triangle.A, triangle.B);
LineSegment ac2 = new LineSegment(triangle.A, triangle.C);
LineSegment bc2 = new LineSegment(triangle.B, triangle.C);
return ab1.IsCrossing(ab2)
|| ab1.IsCrossing(ac2)
|| ab1.IsCrossing(bc2)
|| ac1.IsCrossing(ab2)
|| ac1.IsCrossing(ac2)
|| ac1.IsCrossing(bc2)
|| bc1.IsCrossing(ab2)
|| bc1.IsCrossing(ac2)
|| bc1.IsCrossing(bc2)
|| HasInside(triangle.A)
|| triangle.HasInside(A);
}