Helper utils to find the closest point to a line segment, triangle or tetrahedron.
More...
|
bool | GetBaryCentricCoordinates (Vec3Arg inA, Vec3Arg inB, float &outU, float &outV) |
|
bool | GetBaryCentricCoordinates (Vec3Arg inA, Vec3Arg inB, Vec3Arg inC, float &outU, float &outV, float &outW) |
|
Vec3 | GetClosestPointOnLine (Vec3Arg inA, Vec3Arg inB, uint32 &outSet) |
|
template<bool MustIncludeC = false> |
Vec3 | GetClosestPointOnTriangle (Vec3Arg inA, Vec3Arg inB, Vec3Arg inC, uint32 &outSet) |
|
bool | OriginOutsideOfPlane (Vec3Arg inA, Vec3Arg inB, Vec3Arg inC, Vec3Arg inD) |
| Check if the origin is outside the plane of triangle (inA, inB, inC). inD specifies the front side of the plane. More...
|
|
UVec4 | OriginOutsideOfTetrahedronPlanes (Vec3Arg inA, Vec3Arg inB, Vec3Arg inC, Vec3Arg inD) |
|
template<bool MustIncludeD = false> |
Vec3 | GetClosestPointOnTetrahedron (Vec3Arg inA, Vec3Arg inB, Vec3Arg inC, Vec3Arg inD, uint32 &outSet) |
|
Helper utils to find the closest point to a line segment, triangle or tetrahedron.
template<bool MustIncludeD = false>
Get the closest point between tetrahedron (inA, inB, inC, inD) to the origin outSet specifies which feature was closest, 1 = a, 2 = b, 4 = c, 8 = d. Edges have 2 bits set, triangles 3 and if the point is in the interior 4 bits are set. If MustIncludeD is true, the function assumes that D is part of the closest feature (vertex, edge, face, tetrahedron) and does less work, if the assumption is not true then a closest point to the other features is returned.
template<bool MustIncludeC = false>
Get the closest point to the origin of triangle (inA, inB, inC) outSet describes which features are closest: 1 = a, 2 = b, 4 = c, 5 = line segment ac, 7 = triangle interior etc. If MustIncludeC is true, the function assumes that C is part of the closest feature (vertex, edge, face) and does less work, if the assumption is not true then a closest point to the other features is returned.
Returns for each of the planes of the tetrahedron if the origin is inside it Roughly equivalent to: [OriginOutsideOfPlane(inA, inB, inC, inD), OriginOutsideOfPlane(inA, inC, inD, inB), OriginOutsideOfPlane(inA, inD, inB, inC), OriginOutsideOfPlane(inB, inD, inC, inA)]