Set of bounding boxes for a SceneObject, loaded from a Wavefront file, allowing for collision detection (see README.md).
More...
#include <BoundingBoxSet.hpp>
|
|
int | getNumBoxes () const |
| | Get the number of boxes contained in the set.
|
| |
| | BoundingBoxSet (const std::string fileLocation="") |
| | Constructor. More...
|
| |
|
| ~BoundingBoxSet ()=default |
| | Destructor.
|
| |
| bool | collidesWith (const glm::vec3 point, const glm::vec3 thisOffset, const glm::vec3 thisRotation) const |
| | Check if a point collides (or is inside) any of the boxes of the box set, assuming that they are in a given offset and have a certain rotation. More...
|
| |
| bool | collidesWith (const BoundingBoxSet otherBoxSet, const glm::vec3 thisOffset, const glm::vec3 thisRotation, const glm::vec3 otherOffset, const glm::vec3 otherRotation) const |
| | Check if another set of bounding boxes is located with this set (even partially), thus colliding with it. More...
|
| |
|
|
std::vector< std::vector< float > > | vertices |
| | Vertex coordinates read from Wavefront .obj file.
|
| |
|
std::vector< std::vector< unsigned int > > | facesVertexIndexes |
| | Faces vertex indexes read from Wavefront .obj file.
|
| |
Set of bounding boxes for a SceneObject, loaded from a Wavefront file, allowing for collision detection (see README.md).
◆ BoundingBoxSet()
| small3d::BoundingBoxSet::BoundingBoxSet |
( |
const std::string |
fileLocation = "" | ) |
|
Constructor.
- Parameters
-
| fileLocation | Location of the Wavefront file containing the bounding boxes |
Constructor
◆ collidesWith() [1/2]
| bool small3d::BoundingBoxSet::collidesWith |
( |
const glm::vec3 |
point, |
|
|
const glm::vec3 |
thisOffset, |
|
|
const glm::vec3 |
thisRotation |
|
) |
| const |
Check if a point collides (or is inside) any of the boxes of the box set, assuming that they are in a given offset and have a certain rotation.
- Parameters
-
| point | The point (as a vector) |
| thisOffset | The offset (location) of the box set |
| thisRotation | The rotation of the box set |
- Returns
- True if there is a collision, False if not.
◆ collidesWith() [2/2]
| bool small3d::BoundingBoxSet::collidesWith |
( |
const BoundingBoxSet |
otherBoxSet, |
|
|
const glm::vec3 |
thisOffset, |
|
|
const glm::vec3 |
thisRotation, |
|
|
const glm::vec3 |
otherOffset, |
|
|
const glm::vec3 |
otherRotation |
|
) |
| const |
Check if another set of bounding boxes is located with this set (even partially), thus colliding with it.
- Parameters
-
| otherBoxSet | The other box set |
| thisOffset | The offset (location) of this box set |
| thisRotation | The rotation of this box set |
| otherOffset | The offset (location) of the other box set |
| otherRotation | The rotation of the other box set |
- Returns
- True if there is a collision, False if not.
The documentation for this class was generated from the following files: