36#include "../Triangle/Triangle.h"
37#include "../Vertex/Vertex.h"
45BoundingBox::BoundingBox(
real minX,
real maxX,
real minY,
real maxY,
real minZ,
real maxZ) : minX(minX), maxX(maxX), minY(minY), maxY(maxY), minZ(minZ), maxZ(maxZ) {}
50 std::numeric_limits<real>::lowest(),
51 std::numeric_limits<real>::max(),
52 std::numeric_limits<real>::lowest(),
53 std::numeric_limits<real>::max(),
54 std::numeric_limits<real>::lowest());
69 if (
maxX > this->maxX)
71 if (
maxY > this->maxY)
73 if (
maxZ > this->maxZ)
154 for (
int i = 0;
i < 8;
i++) {
161 void BoundingBox::getPoints(
Vertex v[8])
const
177 printf(
"min/max - x: %2.4f/ %2.4f, y: %2.4f, %2.4f, z: %2.4f, %2.4f \n",
minX,
maxX,
minY,
maxY,
minZ,
maxZ);
bool isInside(const Triangle &t) const
bool intersect(const Triangle &t) const
void setMinMax(const Triangle &t)
std::vector< std::vector< Vertex > > getIntersectionPoints(const BoundingBox &b) const
static BoundingBox makeInvalidMinMaxBox()
bool operator==(const BoundingBox &box) const
std::shared_ptr< T > SPtr
static bool equal(const real &val1, const real &val2, real maxRelDiff=EPSILON)
bool isXbetween(real min, real max) const
bool isZbetween(real min, real max) const
bool isYbetween(real min, real max) const