Documentation / Node reference / code nodes

code/SDFSegment2D

Returns the distance to a 2D line segment.

Sdf2d

Returns the distance to a line segment in the XY plane. It is an open curve, so the distance is never negative.

Parameters

Name Type What it does
P Vector2 Position to measure from. Unwired, it uses the sample position.
a Vector2 First end of the segment.
b Vector2 Second end of the segment.

See also

This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.