/// <summary> /// Return a repulsion line from the closest barrier /// </summary> /// <param name="point">A point in the field</param> /// <param name="barrierType">The type of barrier</param> /// <returns>A line</returns> public UVLine GetRepulsionLine(UV point, BarrierType barrierType) { var collision = CollisionAnalyzer.GetCollidingEdge(point, this, barrierType); if (collision == null) { return(null); } if (collision.ClosestPointOnBarrier == null) { return(null); } return(new UVLine(point, collision.ClosestPointOnBarrier)); }
/// <summary> /// return an instance of the CollisionAnalyzer to determine the collision state of a given point in relation to a barrier type /// </summary> /// <param name="point">A point in the field</param> /// <param name="barrierType">The type of barrier</param> /// <returns>An instance of CollisionAnalyzer</returns> public CollisionAnalyzer GetCollidingEdge(UV point, BarrierType barrierType) { return(CollisionAnalyzer.GetCollidingEdge(point, this, barrierType)); }