Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DRayCast Class Reference

the U4DRayCast class test intersections between a ray and 3D objects More...

Public Member Functions

 U4DRayCast ()
 Ray Cast constructor.
 
 ~U4DRayCast ()
 Ray Cast destructor.
 
bool hit (U4DRay &uRay, U4DModel *uModel, U4DTriangle &uTriangle, U4DPoint3n &uIntersectionPoint, float &uIntersectionParameter)
 Tests intersection between a ray and a 3D model and returns the face (triangle) hit. More...
 

Detailed Description

the U4DRayCast class test intersections between a ray and 3D objects

Member Function Documentation

◆ hit()

bool U4DEngine::U4DRayCast::hit ( U4DRay uRay,
U4DModel uModel,
U4DTriangle uTriangle,
U4DPoint3n uIntersectionPoint,
float &  uIntersectionParameter 
)

Tests intersection between a ray and a 3D model and returns the face (triangle) hit.

Parameters
uRayRay used for the intersection
uModel3D model to test intersection with ray. You must enable the mesh Manager on the model before using this method.
uTriangleface (triangle) of the 3D model intersection with the ray
uIntersectionPointintersection 3D point
uIntersectionParameterintersection parameter, i.e. time
Returns
face of 3d model intersecting with the given ray, along with the intersection point and parameter

Note, to use this method, you need to enable the mesh manager of the 3D model. i.e. enableMeshManager(2)