raycast
PhysicsModuleInterface::raycast
Casts a ray and returns information about the intersection between the ray and the ColliderShape.
Declaration
virtual RaycastInformation raycast(const Math::vec3& rayOrigin, const Math::vec3& rayDirection, float tMin, float tMax, const ColliderShape* shape) = 0;
Parameters
Name |
Type |
Description |
---|---|---|
rayOrigin |
const Math::vec3& |
The origin position of the ray, in world-space. |
rayDirection |
const Math::vec3& |
The direction of the ray. |
tMin |
float |
The minimum distance to check. |
tMax |
float |
The maximum distance to check. |
shape |
const ColliderShape* |
The shape to test the ray intersection on. |
Returns
A RaycastInformation containing information about the intersection. If there is no intersection between the ray and the shape, RaycastInformation::hasIntersected
will be false
.