AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Aire::RigidbodyHandler Class Reference

A singleton class used to handle all rigid bodies in the scene. More...

#include <rigidbodyHandler.h>

Public Member Functions

 RigidbodyHandler (const RigidbodyHandler &rbHandler)=delete
 
void setTerrain (Terrain *aTerrain)
 
void setBoundingVolume (BoundingVolume *aBV)
 A function to set the bounding volume for the scene.
 
RigidbodycreateRigidbodyBox (float aWidth, float aHeight, float aDepth, glm::vec3 pos=glm::vec3(0, 0, 0), glm::mat3 rot=glm::mat3(1.0))
 
RigidbodycreateRigidbodyBall (float aRadius, glm::vec3 pos=glm::vec3(0, 0.1, 0), glm::mat3 rot=glm::mat3(1.0))
 
void deleteRigidbody (int aRbIndex)
 
void updateAll ()
 
bool SphereSphereCollision (Rigidbody *rb1, Rigidbody *rb2)
 
bool BoxBoxCollision (Rigidbody *rb1, Rigidbody *rb2)
 
bool BoxSphereCollision (Rigidbody *rb1, Rigidbody *rb2)
 
bool SphereBoxCollision (Rigidbody *rb1, Rigidbody *rb2)
 
bool PlayerSphereCollision ()
 

Static Public Member Functions

static RigidbodyHandlergetInstance ()
 

Public Attributes

int numRigidbodies
 
std::vector< RbCuboidboxes
 
std::vector< RbSphereballs
 
std::vector< Rigidbody * > rigidbodies
 

Detailed Description

A singleton class used to handle all rigid bodies in the scene.

Member Function Documentation

◆ BoxBoxCollision()

bool RigidbodyHandler::BoxBoxCollision ( Rigidbody * rb1,
Rigidbody * rb2 )

A function to handle cuboids colliding with cuboids

Parameters
rb1The first object
rb2The second object
Returns
True if there will be a collision
Here is the caller graph for this function:

◆ BoxSphereCollision()

bool RigidbodyHandler::BoxSphereCollision ( Rigidbody * rb1,
Rigidbody * rb2 )

A function to handle cuboids colliding with spheres

Parameters
rb1The first object
rb2The second object
Returns
True if there will be a collision
Here is the caller graph for this function:

◆ createRigidbodyBall()

Rigidbody * RigidbodyHandler::createRigidbodyBall ( float aRadius,
glm::vec3 pos = glm::vec3(0, 0.1, 0),
glm::mat3 rot = glm::mat3(1.0) )

A function to create a rigidbody and add it to the set of rigidbodies in the program

Parameters
aRadiusradius of the rigidbody sphere
posoptional positional argument, starting point for rigid body (defaults to 0,0,0).
rotoptional rotational argument, starting orientation for rigid body (defaults to identity)
Returns
A pointer to the created rigidbody stored in rigidbodies
Here is the caller graph for this function:

◆ createRigidbodyBox()

Rigidbody * RigidbodyHandler::createRigidbodyBox ( float aWidth,
float aHeight,
float aDepth,
glm::vec3 pos = glm::vec3(0, 0, 0),
glm::mat3 rot = glm::mat3(1.0) )

A function to create a cuboid rigidbody and add it to the set of rigidbodies in the program

Parameters
aWidth: width of the rigidbody box
aHeightheight of the rigidbody box
aDepth: depth of the rigidbody box
posoptional positional argument, starting point for rigid body (defaults to 0,0,0).
rotoptional rotational argument, starting orientation for rigid body (defaults to identity)
Returns
A pointer to the created rigidbody stored in rigidbodies
Here is the caller graph for this function:

◆ deleteRigidbody()

void RigidbodyHandler::deleteRigidbody ( int aRbIndex)

A function to remove a rigidbody from the rigidbodies vector and stop it from being updated

Parameters
rbIndexThe index of the rigidbody to be destroyed

◆ getInstance()

static RigidbodyHandler * Aire::RigidbodyHandler::getInstance ( )
inlinestatic

A static function to return the instance, if no instance exists one will be created which will be returned in all future calls

Here is the caller graph for this function:

◆ setBoundingVolume()

void RigidbodyHandler::setBoundingVolume ( BoundingVolume * aBV)

A function to set the bounding volume for the scene.

Parameters
aBVThe bounding volume of the scene

◆ setTerrain()

void RigidbodyHandler::setTerrain ( Terrain * aTerrain)

A function to set the terrain of the scene

Parameters
aTerrainThe terrain of the scene
Here is the caller graph for this function:

◆ SphereBoxCollision()

bool RigidbodyHandler::SphereBoxCollision ( Rigidbody * rb1,
Rigidbody * rb2 )

A function to handle spheres colliding with cuboids

Parameters
rb1The first object
rb2The second object
reTestFlag to enable testing for falling collision
Returns
True if there will be a collision
Here is the caller graph for this function:

◆ SphereSphereCollision()

bool RigidbodyHandler::SphereSphereCollision ( Rigidbody * rb1,
Rigidbody * rb2 )

A function to handle spheres colliding with spheres

Parameters
rb1The first object
rb2The second object
Returns
True if there will be a collision
Here is the caller graph for this function:

◆ updateAll()

void RigidbodyHandler::updateAll ( )

A function to update all rigidbodies belonging to the rigidbody handler.

Here is the call graph for this function:
Here is the caller graph for this function:

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