Companion

object Companion

Functions

Link copied to clipboard

Returns true if the given point, when projected onto the plane of the triangle, lies within the triangle.

Link copied to clipboard
fun getBarycoord(point: Vector3, a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3?

Computes a barycentric coordinates from the given vector. Returns null if the triangle is degenerate.

Link copied to clipboard
fun getInterpolatedAttribute(attr: AttributeLike, i1: Int, i2: Int, i3: Int, barycoord: Vector3, target: Vector3): Vector3

Computes the value barycentrically interpolated for the given attribute and indices.

Link copied to clipboard
fun getInterpolation(point: Vector3, p1: Vector3, p2: Vector3, p3: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3?

Computes the value barycentrically interpolated for the given point on the triangle. Returns null if the triangle is degenerate.

Link copied to clipboard
fun getNormal(a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3

Computes the normal vector of a triangle.

Link copied to clipboard
fun isFrontFacing(a: Vector3, b: Vector3, c: Vector3, direction: Vector3): Boolean

Returns true if the triangle is oriented towards the given direction.