Segment
Last updated
Was this helpful?
Last updated
Was this helpful?
A segment is a object defined by two . It is not a and its points are absolute, which differentiates it from the class.
The following code creates two . One line rotates automatically while the other is controlled by input from the . The two call the AsSegment method to create Segments that represent the calling . The segment can then be used to find the point of collision between the two . If the resulting intersection point has valid coordinates then a collision has occurred. A red ball marks the intersection point between the two .
Add the following using statements:
Add the following at class scope:
Add the following in Initialize after initializing FlatRedBall:
Add the following in Update:
Did this article leave any questions unanswered? Post any question in our for a rapid response.