ProtoFlux:Ray To Line Intersection

From Resonite Wiki
Revision as of 00:19, 3 July 2024 by Yosh (talk | contribs) (add see also)
Ray To Line Intersection
Origin
Intersection
Direction
Intersects
LinePoint0
LinePoint1
Geometry 2D

The Ray To Line Intersection node determines the point at which a ray defined by an origin and direction intersects a line segment defined by two points.

Inputs

Origin (float2)

Origin of the ray.

Direction (float2)

Direction of the ray.

LinePoint0 (float2)

First point of the line segment.

LinePoint1 (float2)

Second point of the line segment.

Outputs

Intersection (float2)

The point at which the defined ray intersects with the line segment defined by LinePoint0 and LinePoint1. If the ray does not intersect, the value will be [0; 0].

Intersects (bool)

True if the ray intersects with Rectangle, False otherwise. If the defined ray has both the same slope and lies on the line segment, it will not count as intersection. If the ray starts on the line segment and has a distinct slope from the line segment, it will count as intersection, and the intersection point will be Origin.

Examples

See Also