Ray

data class Ray(val origin: Vec3, val direction: Vec3) : LinearGeometry3

Constructors

Link copied to clipboard
constructor(origin: Vec3, direction: Vec3)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val anchor: Vec3

Parameter-zero point of this geometry.

Link copied to clipboard
open override val direction: Vec3

Direction vector of the supporting line.

Link copied to clipboard
val origin: Vec3

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.