30 uint32_t numBoxes = 0;
33 void generateBoxesFromExtremes();
34 void generateExtremes(
const std::vector<float>& vertexData,
const Vec3& scale, uint32_t subdivisions);
35 void generateSubExtremes(
const std::vector<float>& vertexData,
const Vec3& scale);
44 float minZ = 0.0f, maxZ = 0.0f, minX = 0.0f, maxX = 0.0f, minY = 0.0f, maxY = 0.0f;
76 BoundingBoxSet(
const std::vector<float>& vertexData,
const Vec3& scale, uint32_t subdivisions);
109 const Mat4& thisRotation)
const;
124 const Vec3& thisOffset,
125 const Mat4& thisRotation,
126 const Vec3& otherOffset,
127 const Mat4& otherRotation)
const;
Vectors, matrices and other math things.
Set of bounding boxes for a SceneObject, calculated based on the vertices of a Model.
Definition BoundingBoxSet.hpp:27
int getNumBoxes() const
Get the number of boxes contained in the set.
Definition BoundingBoxSet.cpp:321
std::vector< std::vector< unsigned int > > facesVertexIndexes
Faces vertex indexes (rectangles)
Definition BoundingBoxSet.hpp:93
std::vector< std::vector< unsigned int > > facesVertexIndexesTriangulated
Faces vertex indexes (triangles, for rendering)
Definition BoundingBoxSet.hpp:98
bool contains(const Vec3 &point, const Vec3 &thisOffset, const Mat4 &thisRotation) const
Check if a point is inside any of the boxes.
Definition BoundingBoxSet.cpp:27
~BoundingBoxSet()=default
Destructor.
std::vector< extremes > boxExtremes
The extreme coordinates (max and min) of each box.
Definition BoundingBoxSet.hpp:52
std::vector< Model > getModels()
Get the bounding boxes in a set of Models that can be rendered.
Definition BoundingBoxSet.cpp:325
BoundingBoxSet()
Default constructor.
Definition BoundingBoxSet.cpp:17
std::vector< std::vector< float > > vertices
Vertex coordinates.
Definition BoundingBoxSet.hpp:87
bool containsCorners(const BoundingBoxSet &otherBoxSet, const Vec3 &thisOffset, const Mat4 &thisRotation, const Vec3 &otherOffset, const Mat4 &otherRotation) const
Check any of the corners of another set of bounding boxes is inside any of the boxes of this set.
Definition BoundingBoxSet.cpp:49
Definition BinaryFile.hpp:15
Structure to hold the coordinates of the extremes of each box.
Definition BoundingBoxSet.hpp:42
4x4 float matrix
Definition Math.hpp:112
3 component float vector
Definition Math.hpp:21