Class VectorMath
Various vector math utility functions.
A lot of functions in the Polygon class have been moved to this class the names have changed slightly and everything now consistently assumes a left handed coordinate system now instead of sometimes using a left handed one and sometimes using a right handed one. This is why the 'Left' methods in the Polygon class redirect to methods named 'Right'. The functionality is exactly the same.
Note the difference between segments and lines. Lines are infinitely long but segments have only a finite length.
Public Static Methods
Calculates the intersection points between a "capsule" (segment expanded by a radius), and a line.
Returns the closest point on the segment in the XZ plane.
Returns true if the points a in a clockwise order or if they are colinear.
Returns true if the points a in a clockwise order or if they are colinear.
Intersection of a line and a circle.
Calculates the two intersection points (point + direction*t) on the line where it intersects with a circle at the origin.
Intersection point between two infinite lines.
Returns the intersection factor...
Returns the intersection point between the two lines.
Returns the intersection point between the two lines.
Calculates the point start1 + dir1*t where the two infinite lines intersect.
Calculates the point start1 + dir1*factor1 == start2 + dir2*factor2 where the two infinite lines intersect.
Returns the intersection factor for line 1 with ray 2.
Returns if the ray (start1, end1) intersects the segment (start2, end2).
Calculates the two intersection points (lerp(point1, point2, t)) on the segment where it intersects with a circle at the origin.
Returns the intersection point between the two line segments in XZ space.
Returns if the line segment start2 - end2 intersects the line segment start1 - end1.
Returns the approximate shortest squared distance between x,z and the segment p-q.