37 BoundingBox(
const glm::vec3 & v0,
const glm::vec3 & v1);
44 BoundingBox(
const glm::vec3 & v0,
const glm::vec3 & v1,
const glm::vec3 & v2);
54 void merge(
const glm::vec3 & point);
93 bool contains(
const glm::vec3 & point)
const;
98 glm::vec3
minis = glm::vec3(std::numeric_limits<float>::max());
99 glm::vec3
maxis = glm::vec3(std::numeric_limits<float>::lowest());
127 static glm::mat4
perspective(
float fov,
float ratio,
float near,
float far);
138 static glm::mat4
ortho(
float left,
float right,
float bottom,
float top,
float near,
float far);
144 LEFT = 0, RIGHT = 1, TOP = 2, BOTTOM = 3, NEAR = 4, FAR = 5, COUNT = 6
147 std::array<glm::vec4, FrustumPlane::COUNT>
_planes;
Represent the smallest axis-aligne box containing a given object or region of space.
Definition: Bounds.hpp:28
void merge(const BoundingBox &box)
Definition: Bounds.cpp:17
bool empty() const
Definition: Bounds.cpp:83
BoundingSphere getSphere() const
Definition: Bounds.cpp:27
std::vector< glm::vec3 > getCorners() const
Definition: Bounds.cpp:37
bool contains(const glm::vec3 &point) const
Definition: Bounds.cpp:79
glm::vec3 getCentroid() const
Definition: Bounds.cpp:61
std::vector< glm::vec4 > getHomogeneousCorners() const
Definition: Bounds.cpp:49
glm::vec3 minis
Lower-back-left corner of the box.
Definition: Bounds.hpp:98
BoundingBox transformed(const glm::mat4 &trans) const
Definition: Bounds.cpp:65
glm::vec3 maxis
Higher-top-right corner of the box.
Definition: Bounds.hpp:99
glm::vec3 getSize() const
Definition: Bounds.cpp:33
Represent the sphere of smallest radius containing a given object or region of space.
Definition: Bounds.hpp:9
glm::vec3 center
The sphere center.
Definition: Bounds.hpp:20
float radius
The sphere radius.
Definition: Bounds.hpp:21
Represent a 3D frustum, volume defined by the intersection of six planes.
Definition: Bounds.hpp:106
std::array< glm::vec4, FrustumPlane::COUNT > _planes
Frustum hyperplane coefficients.
Definition: Bounds.hpp:147
std::array< glm::vec3, 8 > _corners
Frustum corners.
Definition: Bounds.hpp:148
FrustumPlane
Definition: Bounds.hpp:143
static glm::mat4 ortho(float left, float right, float bottom, float top, float near, float far)
Definition: Bounds.cpp:146
static glm::mat4 perspective(float fov, float ratio, float near, float far)
Definition: Bounds.cpp:137
bool intersects(const BoundingBox &box) const
Definition: Bounds.cpp:118