An extended version of three.js' Triangle class. A variety of derivative values are cached on
the object to accelerate the intersection functions. .needsUpdate must be set to true when
modifying the triangle parameters.
On this page
Properties
needsUpdate: boolean
Indicates that the triangle fields have changed so cached variables to accelerate other
function execution can be updated. Must be set to true after modifying the triangle
a, b, c fields.
Methods
intersectsSphere( sphere: Sphere ): booleanReturns whether the triangle intersects the given sphere.
closestPointToSegment(
segment: Line3,
target1?: Vector3,
target2?: Vector3
): numberReturns the distance to the provided line segment. target1 and target2 are set to the
closest points on the triangle and segment respectively.
intersectsTriangle(
other: Triangle,
target?: Line3,
suppressLog: boolean = false
): booleanReturns whether the triangles intersect. target is set to the line segment representing
the intersection.
distanceToPoint( point: Vector3 ): numberReturns the distance to the provided point.
distanceToTriangle(
other: Triangle,
target1?: Vector3,
target2?: Vector3
): numberReturns the distance to the provided triangle.