Readonly
v1The first vertex of the bounding volume hierarchy (BVH) node. This vertex is used to define the geometry or bounds associated with the node.
Readonly
v2The second vertex associated with this BVH node. Used to define the geometry or bounds within the BVH structure.
Readonly
v3The third vertex of the BVH structure.
Creates a deep copy of the current BVHTriangle
instance.
A new BVHTriangle
object with cloned vertex data.
Calculates and returns the centroid of the triangle defined by vertices v1
, v2
, and v3
.
The centroid is computed as the average of the x, y, and z coordinates of the three vertices.
The centroid of the triangle as a Vertex3d
object.
Generates a unique hash string for the current object by concatenating
the hash values of its three vertices (v1
, v2
, and v3
).
A string representing the combined hash of the three vertices.
Calculates the intersection point of a line segment (defined by pt1
and pt2
)
with the plane of the triangle defined by the instance vertices (v1
, v2
, v3
).
Returns the intersection point as a BVHVertex
if it lies within the triangle,
otherwise returns undefined
.
The intersection point as a BVHVertex
if it is inside the triangle, or undefined
otherwise.
Creates a new BVHTriangle instance from three vertices.
Each vertex is wrapped in a BVHVertex. The constructor checks for duplicate vertices by comparing their hashes. If all three vertices are identical, an error is thrown.