Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
RayTriangle.h File Reference

Go to the source code of this file.

Functions

JPH_NAMESPACE_BEGIN JPH_INLINE float RayTriangle (Vec3Arg inOrigin, Vec3Arg inDirection, Vec3Arg inV0, Vec3Arg inV1, Vec3Arg inV2)
 
JPH_INLINE Vec4 RayTriangle4 (Vec3Arg inOrigin, Vec3Arg inDirection, Vec4Arg inV0X, Vec4Arg inV0Y, Vec4Arg inV0Z, Vec4Arg inV1X, Vec4Arg inV1Y, Vec4Arg inV1Z, Vec4Arg inV2X, Vec4Arg inV2Y, Vec4Arg inV2Z)
 Intersect ray with 4 triangles in SOA format, returns 4 vector of closest points or FLT_MAX if no hit (uses bit tricks to do less divisions)
 

Function Documentation

◆ RayTriangle()

JPH_NAMESPACE_BEGIN JPH_INLINE float RayTriangle ( Vec3Arg  inOrigin,
Vec3Arg  inDirection,
Vec3Arg  inV0,
Vec3Arg  inV1,
Vec3Arg  inV2 
)

Intersect ray with triangle, returns closest point or FLT_MAX if no hit (branch less version) Adapted from: http://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm

◆ RayTriangle4()

JPH_INLINE Vec4 RayTriangle4 ( Vec3Arg  inOrigin,
Vec3Arg  inDirection,
Vec4Arg  inV0X,
Vec4Arg  inV0Y,
Vec4Arg  inV0Z,
Vec4Arg  inV1X,
Vec4Arg  inV1Y,
Vec4Arg  inV1Z,
Vec4Arg  inV2X,
Vec4Arg  inV2Y,
Vec4Arg  inV2Z 
)

Intersect ray with 4 triangles in SOA format, returns 4 vector of closest points or FLT_MAX if no hit (uses bit tricks to do less divisions)