ReactPhysics3D
v0.10.2
C++ Physics engine library
|
This class can be used to register a callback for ray casting queries. More...
#include <include/reactphysics3d/collision/RaycastInfo.h>
Public Member Functions | |
virtual | ~RaycastCallback () |
Destructor. | |
virtual decimal | notifyRaycastHit (const RaycastInfo &raycastInfo)=0 |
This method will be called for each collider that is hit by the ray. | |
This class can be used to register a callback for ray casting queries.
You should implement your own class inherited from this one and implement the notifyRaycastHit() method. This method will be called for each collider that is hit by the ray.
|
pure virtual |
This method will be called for each collider that is hit by the ray.
You cannot make any assumptions about the order of the calls. You should use the return value to control the continuation of the ray. The returned value is the next maxFraction value to use. If you return a fraction of 0.0, it means that the raycast should terminate. If you return a fraction of 1.0, it indicates that the ray is not clipped and the ray cast should continue as if no hit occurred. If you return the fraction in the parameter (hitFraction value in the RaycastInfo object), the current ray will be clipped to this fraction in the next queries. If you return -1.0, it will ignore this collider and continue the ray cast.
raycastInfo | Information about the raycast hit |