LinearGeometry3

sealed interface LinearGeometry3

Shared contract for one-dimensional linear geometry in 3D space.

Implementations define their own valid parameter domain, while anchor and direction always describe the shared supporting line equation anchor + direction * t.

Inheritors

Properties

Link copied to clipboard
abstract val anchor: Vec3

Parameter-zero point of this geometry.

Link copied to clipboard
abstract val direction: Vec3

Direction vector of the supporting line.

Functions

Link copied to clipboard
open fun distanceToSqr(point: Vec3): Double

Returns the squared distance from point to this geometry.

Link copied to clipboard
open fun firstIntersectionWith(box: AABB): Vec3?

Returns the first boundary intersection with box in parameter order.

Link copied to clipboard
open fun getNearestPointsTo(other: LinearGeometry3): Pair<Vec3, Vec3>?

Returns the nearest point pair between this geometry and other.

Link copied to clipboard

Returns the nearest point on this geometry to box.

open fun getNearestPointTo(point: Vec3): Vec3

Returns the nearest point on this geometry to point.

open fun getNearestPointTo(shape: VoxelShape): NearestPointResult?

Returns the nearest point on this geometry to shape.

Link copied to clipboard
open fun intersects(box: AABB): Boolean

Returns whether this geometry intersects box within its parameter domain.

Link copied to clipboard
open fun parameterFor(point: Vec3): Double

Returns the unconstrained projection parameter of point on the supporting line.

open fun parameterFor(x: Double, y: Double, z: Double): Double

Returns the unconstrained projection parameter of input position on the supporting line.

Link copied to clipboard
open fun pointAt(parameter: Double): Vec3

Returns the point on the supporting line at parameter.

Link copied to clipboard
open fun pointAtOrNull(parameter: Double): Vec3?

Returns the point at parameter if it belongs to this geometry's parameter domain.