![]() |
AireEngine
A 3D Open-World Game Engine
|
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. | |
| Rigidbody * | createRigidbodyBox (float aWidth, float aHeight, float aDepth, glm::vec3 pos=glm::vec3(0, 0, 0), glm::mat3 rot=glm::mat3(1.0)) |
| Rigidbody * | createRigidbodyBall (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 RigidbodyHandler * | getInstance () |
Public Attributes | |
| int | numRigidbodies |
| std::vector< RbCuboid > | boxes |
| std::vector< RbSphere > | balls |
| std::vector< Rigidbody * > | rigidbodies |
A singleton class used to handle all rigid bodies in the scene.
A function to handle cuboids colliding with cuboids
| rb1 | The first object |
| rb2 | The second object |

A function to handle cuboids colliding with spheres
| rb1 | The first object |
| rb2 | The second object |

| 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
| aRadius | radius of the rigidbody sphere |
| pos | optional positional argument, starting point for rigid body (defaults to 0,0,0). |
| rot | optional rotational argument, starting orientation for rigid body (defaults to identity) |

| 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
| aWidth | : width of the rigidbody box |
| aHeight | height of the rigidbody box |
| aDepth | : depth of the rigidbody box |
| pos | optional positional argument, starting point for rigid body (defaults to 0,0,0). |
| rot | optional rotational argument, starting orientation for rigid body (defaults to identity) |

A function to remove a rigidbody from the rigidbodies vector and stop it from being updated
| rbIndex | The index of the rigidbody to be destroyed |
|
inlinestatic |
A static function to return the instance, if no instance exists one will be created which will be returned in all future calls

| void RigidbodyHandler::setBoundingVolume | ( | BoundingVolume * | aBV | ) |
A function to set the bounding volume for the scene.
| aBV | The bounding volume of the scene |
A function to set the terrain of the scene
| aTerrain | The terrain of the scene |

A function to handle spheres colliding with cuboids
| rb1 | The first object |
| rb2 | The second object |
| reTest | Flag to enable testing for falling collision |

A function to handle spheres colliding with spheres
| rb1 | The first object |
| rb2 | The second object |

| void RigidbodyHandler::updateAll | ( | ) |
A function to update all rigidbodies belonging to the rigidbody handler.

