The small3d framework
BoundingBoxSet.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <memory>
14 #include "Logger.hpp"
15 #include <vector>
16 #include <glm/glm.hpp>
17 
18 namespace small3d {
19 
27  private:
28  int numBoxes;
29  void loadFromFile(std::string fileLocation);
30 
31  public:
32 
37  int getNumBoxes() const;
38 
46  BoundingBoxSet(const std::string fileLocation = "");
47 
51  ~BoundingBoxSet() = default;
52 
57  std::vector<std::vector<float> > vertices;
58 
63  std::vector<std::vector<unsigned int> > facesVertexIndexes;
64 
75  bool collidesWith(const glm::vec3 point, const glm::vec3 thisOffset,
76  const glm::vec3 thisRotation) const;
77 
89  bool collidesWith(const BoundingBoxSet otherBoxSet,
90  const glm::vec3 thisOffset,
91  const glm::vec3 thisRotation,
92  const glm::vec3 otherOffset,
93  const glm::vec3 otherRotation) const;
94 
95  };
96 }
BoundingBoxSet(const std::string fileLocation="")
Constructor.
Definition: BoundingBoxSet.cpp:29
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...
Definition: BoundingBoxSet.cpp:154
std::vector< std::vector< float > > vertices
Vertex coordinates read from Wavefront .obj file.
Definition: BoundingBoxSet.hpp:57
int getNumBoxes() const
Get the number of boxes contained in the set.
Definition: BoundingBoxSet.cpp:264
Header of the Logger class.
~BoundingBoxSet()=default
Destructor.
Set of bounding boxes for a SceneObject, loaded from a Wavefront file, allowing for collision detecti...
Definition: BoundingBoxSet.hpp:26
std::vector< std::vector< unsigned int > > facesVertexIndexes
Faces vertex indexes read from Wavefront .obj file.
Definition: BoundingBoxSet.hpp:63