25 #define GLM_FORCE_CTOR_INIT
26 #include <glm/glm.hpp>
27 #define GLM_ENABLE_EXPERIMENTAL
28 #include <glm/ext.hpp>
29 #include <glm/gtx/io.hpp>
53 using vec = glm::vec<3, T>;
58 : _min(glm::min(pMin, pMax))
59 , _max(glm::max(pMin, pMax))
62 inline bool operator==(
const Box<T>& other)
const {
return _min == other._min && _max == other._max; }
66 _min = glm::min(_min, aabb.
getMin());
67 _max = glm::max(_max, aabb.
getMax());
72 _min = glm::min(_min,
point);
73 _max = glm::max(_max,
point);
78 _min = glm::max(_min, aabb.
getMin());
79 _max = glm::min(_max, aabb.
getMax());
84 _min =
vec(std::numeric_limits<T>::max());
85 _max =
vec(-std::numeric_limits<T>::max());
88 inline bool isEmpty()
const {
return _min.x >= _max.x || _min.y >= _max.y || _min.z >= _max.x; }
95 #ifdef __INTEL_COMPILER
97 vec _min{std::numeric_limits<T>::max()};
98 vec _max{-std::numeric_limits<T>::max()};
101 vec _min{std::numeric_limits<T>::max()};
102 vec _max{-std::numeric_limits<T>::max()};
109 template <
typename T>
159 if (glm::abs(glm::dot(
vector, upVector)) > 0.999)
162 return quatLookAtRH(
vector, upVector);
#define SERIALIZATION_FRIEND(type)
void intersect(const Box< T > &aabb)
Box(const vec &pMin, const vec &pMax)
const vec & getMin() const
bool operator==(const Box< T > &other) const
void merge(const vec &point)
const vec & getMax() const
void merge(const Box< T > &aabb)
Quaterniond safeQuatlookAt(const Vector3d &v)
glm::vec< 3, uint32_t > Vector3ui
glm::vec< 2, int32_t > Vector2i
glm::mat< 4, 4, double > Matrix4d
glm::vec< 3, double > Vector3d
std::vector< Vector2d > Vector2ds
glm::vec< 3, int32_t > Vector3i
glm::vec< 2, double > Vector2d
std::vector< Vector4f > Vector4fs
glm::tquat< double, glm::highp > Quaterniond
Double quaternion.
std::ostream & operator<<(std::ostream &os, const Box< T > &aabb)
glm::vec< 4, double > Vector4d
glm::vec< 2, uint32_t > Vector2ui
std::vector< Vector3f > Vector3fs
void init(core::Box< U > *, ObjectHandler *)