40 lines
790 B
C++
40 lines
790 B
C++
#ifndef BLUECORE_BOUNDING_CUBE_H
|
|
#define BLUECORE_BOUNDING_CUBE_H
|
|
|
|
#include "Math/Transformation.h"
|
|
|
|
namespace BlueCore
|
|
{
|
|
|
|
class AABB
|
|
{
|
|
|
|
public:
|
|
Vector3 Min;
|
|
Vector3 Max;
|
|
|
|
bool overlaps (const AABB &aabb)
|
|
{
|
|
bool overlap = true;
|
|
|
|
overlap = (Min.x > aabb.Max.x || Max.x < aabb.Min.x) ? false : overlap;
|
|
overlap = (Min.y > aabb.Max.y || Max.y < aabb.Min.y) ? false : overlap;
|
|
overlap = (Min.z > aabb.Max.z || Max.z < aabb.Min.z) ? false : overlap;
|
|
|
|
return overlap;
|
|
}
|
|
|
|
AABB transformed (const Transformation& transformation)
|
|
{
|
|
AABB aabb;
|
|
/*
|
|
Vector3 new_max = transformation.transform (Max);
|
|
Vector3 new_min = transformation.transform (Min);
|
|
*/
|
|
return aabb;
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif
|