computePlaneDistances

fun computePlaneDistances(position: Cartesian3, direction: Cartesian3, result: Interval? = definedExternally): Interval(source)

The distances calculated by the vector from the center of the bounding box to position projected onto direction.

If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the closest and farthest planes from position that intersect the bounding box.

Return

The nearest and farthest distances on the bounding box from position in direction.

Parameters

position

The position to calculate the distance from.

direction

The direction from position.

result

A Interval to store the nearest and farthest distances.

See also