Raylib C++  1.0.0
Encapsulates the raylib library
Static Public Member Functions | List of all members
raylib::helper::Collision3dHelper Class Reference

Helper class for 3D collision detection. More...

#include <Collision3DHelper.hpp>

Collaboration diagram for raylib::helper::Collision3dHelper:
Collaboration graph

Static Public Member Functions

static bool checkCollisionSpheres (const Vector3f &center1, const float &radius1, const Vector3f &center2, const float &radius2)
 Check collision between two spheres. More...
 
static bool checkCollisionBoxes (const BoundingBox &box1, const BoundingBox &box2)
 Check collision between two bounding boxes. More...
 
static bool checkCollisionBoxSphere (const BoundingBox &box, const Vector3f &center, const float &radius)
 Check collision between a bounding box and a sphere. More...
 
static RayCollision getRayCollisionSphere (const Ray &ray, const Vector3f &center, const float &radius)
 Get collision info between ray and sphere. More...
 
static RayCollision getRayCollisionBox (const Ray &ray, const BoundingBox &box)
 Get collision info between ray and box. More...
 
static RayCollision getRayCollisionModel (const Ray &ray, const model::RlModel &model)
 Get collision info between ray and model. More...
 
static RayCollision getRayCollisionMesh (const Ray &ray, const model::RlMesh &mesh, const Matrix &transform)
 Get collision info between ray and mesh. More...
 
static RayCollision getRayCollisionTriangle (const Ray &ray, const Vector3f &p1, const Vector3f &p2, const Vector3f &p3)
 Get collision info between ray and triangle. More...
 
static RayCollision getRayCollisionQuad (const Ray &ray, const Vector3f &p1, const Vector3f &p2, const Vector3f &p3, const Vector3f &p4)
 Get collision info between ray and quad. More...
 

Detailed Description

Helper class for 3D collision detection.

Member Function Documentation

◆ checkCollisionBoxes()

bool raylib::helper::Collision3dHelper::checkCollisionBoxes ( const BoundingBox &  box1,
const BoundingBox &  box2 
)
static

Check collision between two bounding boxes.

Parameters
box1Bounding box of the first object
box2Bounding box of the second object
Returns
If the two bounding boxes are colliding
Here is the caller graph for this function:

◆ checkCollisionBoxSphere()

bool raylib::helper::Collision3dHelper::checkCollisionBoxSphere ( const BoundingBox &  box,
const Vector3f center,
const float &  radius 
)
static

Check collision between a bounding box and a sphere.

Parameters
boxBounding box of the object
centerCenter of the sphere
radiusRadius of the sphere
Returns
If the bounding box and the sphere are colliding
Here is the call graph for this function:

◆ checkCollisionSpheres()

bool raylib::helper::Collision3dHelper::checkCollisionSpheres ( const Vector3f center1,
const float &  radius1,
const Vector3f center2,
const float &  radius2 
)
static

Check collision between two spheres.

Parameters
center1Center of the first sphere
radius1Radius of the first sphere
center2Center of the second sphere
radius2Radius of the second sphere
Returns
If the two spheres are colliding
Here is the call graph for this function:

◆ getRayCollisionBox()

RayCollision raylib::helper::Collision3dHelper::getRayCollisionBox ( const Ray &  ray,
const BoundingBox &  box 
)
static

Get collision info between ray and box.

Parameters
rayRay
boxBounding box
Returns
If the ray and the box are colliding

◆ getRayCollisionMesh()

RayCollision raylib::helper::Collision3dHelper::getRayCollisionMesh ( const Ray &  ray,
const model::RlMesh mesh,
const Matrix &  transform 
)
static

Get collision info between ray and mesh.

Parameters
rayRay
meshMesh
transformTransform of the mesh
Returns
If the ray and the mesh are colliding
Here is the call graph for this function:

◆ getRayCollisionModel()

RayCollision raylib::helper::Collision3dHelper::getRayCollisionModel ( const Ray &  ray,
const model::RlModel model 
)
static

Get collision info between ray and model.

Parameters
rayRay
modelModel
Returns
If the ray and the model are colliding
Here is the call graph for this function:

◆ getRayCollisionQuad()

RayCollision raylib::helper::Collision3dHelper::getRayCollisionQuad ( const Ray &  ray,
const Vector3f p1,
const Vector3f p2,
const Vector3f p3,
const Vector3f p4 
)
static

Get collision info between ray and quad.

Parameters
rayRay
p1Vertex 1 of the quad
p2Vertex 2 of the quad
p3Vertex 3 of the quad
p4Vertex 4 of the quad
Returns
If the ray and the quad are colliding
Here is the call graph for this function:

◆ getRayCollisionSphere()

RayCollision raylib::helper::Collision3dHelper::getRayCollisionSphere ( const Ray &  ray,
const Vector3f center,
const float &  radius 
)
static

Get collision info between ray and sphere.

Parameters
rayRay
centerCenter of the sphere
radiusRadius of the sphere
Returns
If the ray and the sphere are colliding
Here is the call graph for this function:

◆ getRayCollisionTriangle()

RayCollision raylib::helper::Collision3dHelper::getRayCollisionTriangle ( const Ray &  ray,
const Vector3f p1,
const Vector3f p2,
const Vector3f p3 
)
static

Get collision info between ray and triangle.

Parameters
rayRay
p1Vertex 1 of the triangle
p2Vertex 2 of the triangle
p3Vertex 3 of the triangle
Returns
If the ray and the triangle are colliding
Here is the call graph for this function:

The documentation for this class was generated from the following files: