Line

open class Line

Represents a line in Cartesian coordinates.

Constructors

Link copied to clipboard
constructor()

Constructs a line with origin and direction both zero.

constructor(origin: Vec3, direction: Vec3)

Constructs a line with a specified origin and direction.

constructor(line: Line)

Constructs a line with the origin and direction from a specified line.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

This line's direction.

Link copied to clipboard

This line's origin.

Functions

Link copied to clipboard
fun computeTriangleIntersection(vertex0: Vec3, vertex1: Vec3, vertex2: Vec3, result: Vec3): Boolean

Computes the Cartesian intersection point of a specified line with a triangle. Taken from Moller and Trumbore.

Link copied to clipboard

Computes the Cartesian intersection point(s) of a specified line with a non-indexed list of triangle vertices.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun pointAt(distance: Double, result: Vec3): Vec3

Computes a Cartesian point a specified distance along this line.

Link copied to clipboard
fun set(origin: Vec3, direction: Vec3): Line

Sets this line to a specified origin and direction.

Link copied to clipboard
fun setToSegment(pointA: Vec3, pointB: Vec3): Line

Sets this line to the specified segment. This line has its origin at the first endpoint and its direction extending from the first endpoint to the second.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun triStripIntersection(points: FloatArray, stride: Int, elements: ShortArray, count: Int, result: Vec3): Boolean

Computes the first intersection of a triangle strip with this line. This line is interpreted as a ray; intersection points behind the line's origin are ignored.
The triangle strip is specified by a list of vertex points and a list of elements indicating the triangle strip tessellation of those vertices. The triangle strip elements are interpreted in the same manner as OpenGL, where each index indicates a vertex position rather than an actual index into the points array (e.g. a triangle strip index of 1 indicates the XYZ tuple starting at array index 3).