UtilCalculateLineLineIntersection Method (Vector3, Vector3, Vector3, Vector3, Vector3, Vector3) |
Calculates the intersection line segment between 2 lines (not segments).
Namespace:
Demo3D.Common
Assembly:
Demo3D.Common (in Demo3D.Common.dll) Version: 15.0.2.11458
Syntaxpublic static bool CalculateLineLineIntersection(
Vector3 line1Point1,
Vector3 line1Point2,
Vector3 line2Point1,
Vector3 line2Point2,
out Vector3 resultSegmentPoint1,
out Vector3 resultSegmentPoint2
)
Parameters
- line1Point1
- Type: Microsoft.DirectXVector3
Start of the first line. - line1Point2
- Type: Microsoft.DirectXVector3
End of the first line. - line2Point1
- Type: Microsoft.DirectXVector3
Start of the second line. - line2Point2
- Type: Microsoft.DirectXVector3
End of the second line. - resultSegmentPoint1
- Type: Microsoft.DirectXVector3
Start of the resulting line segment. - resultSegmentPoint2
- Type: Microsoft.DirectXVector3
End of the resulting line segment.
Return Value
Type:
Boolean
Returns false if no solution is found (lines are parallel or co-incident) or true if
resultSegmentPoint1 and
resultSegmentPoint2 are filled in; noting that if the lines actually do intersect, these two values will be the same.
Remarks
It returns a line segment, because in general, two 3D lines will not actually intersect, but there is a line segment which joins the two
lines at the point where the distance between them is minimised.
See Also