ClosestPointTo
Last updated
Was this helpful?
Last updated
Was this helpful?
The ClosestPointTo returns the closest point on the calling Segment to the argument position. The closest point may be anywhere on the segment including the endpoints.
The following creates a Segment and a as a visible representation of the Segment. The update method finds the closest point on the Segment to the and positions a there.
Add the following using statements:
Add the following at class scope:
Add the following to Initialize after initializing FlatRedBall:
Add the following to Update: