18 #include <glm/glm.hpp>
31 AACube(
const AABox& other);
32 AACube(
const Extents& other);
33 AACube(
const glm::vec3& corner,
float size);
37 void setBox(
const glm::vec3& corner,
float scale);
38 glm::vec3 getFarthestVertex(
const glm::vec3& normal)
const;
39 glm::vec3 getNearestVertex(
const glm::vec3& normal)
const;
40 void scale(
float scale);
41 const glm::vec3& getCorner()
const {
return _corner; }
42 float getScale()
const {
return _scale; }
43 glm::vec3 getDimensions()
const {
return glm::vec3(_scale,_scale,_scale); }
44 float getLargestDimension()
const {
return _scale; }
46 glm::vec3 calcCenter()
const;
47 glm::vec3 calcTopFarLeft()
const;
48 glm::vec3 getVertex(BoxVertex vertex)
const;
50 const glm::vec3& getMinimumPoint()
const {
return _corner; }
51 glm::vec3 getMaximumPoint()
const {
return calcTopFarLeft(); }
53 bool contains(
const glm::vec3& point)
const;
54 bool contains(
const AACube& otherCube)
const;
55 bool touches(
const AACube& otherCube)
const;
56 bool contains(
const AABox& otherBox)
const;
57 bool touches(
const AABox& otherBox)
const;
58 bool expandedContains(
const glm::vec3& point,
float expansion)
const;
59 bool expandedIntersectsSegment(
const glm::vec3& start,
const glm::vec3& end,
float expansion)
const;
60 bool findRayIntersection(
const glm::vec3& origin,
const glm::vec3& direction,
const glm::vec3& invDirection,
61 float& distance, BoxFace& face, glm::vec3& surfaceNormal)
const;
62 bool findParabolaIntersection(
const glm::vec3& origin,
const glm::vec3& velocity,
const glm::vec3& acceleration,
63 float& parabolicDistance, BoxFace& face, glm::vec3& surfaceNormal)
const;
64 bool touchesSphere(
const glm::vec3& center,
float radius)
const;
65 bool findSpherePenetration(
const glm::vec3& center,
float radius, glm::vec3& penetration)
const;
66 bool findCapsulePenetration(
const glm::vec3& start,
const glm::vec3& end,
float radius, glm::vec3& penetration)
const;
68 AABox clamp(
const glm::vec3& min,
const glm::vec3& max)
const;
69 AABox clamp(
float min,
float max)
const;
71 AACube& operator += (
const glm::vec3& point);
73 bool containsNaN()
const;
76 glm::vec3 getClosestPointOnFace(
const glm::vec3& point, BoxFace face)
const;
77 glm::vec3 getClosestPointOnFace(
const glm::vec4& origin,
const glm::vec4& direction, BoxFace face)
const;
78 glm::vec4 getPlane(BoxFace face)
const;
80 static BoxFace getOppositeFace(BoxFace face);
90 inline bool operator==(
const AACube& a,
const AACube& b) {
91 return a.getCorner() == b.getCorner() && a.getScale() == b.getScale();
94 inline bool operator!=(
const AACube& a,
const AACube& b) {
95 return a.getCorner() != b.getCorner() || a.getScale() != b.getScale();
98 inline QDebug operator<<(QDebug debug,
const AACube& cube) {
100 << cube.getCorner().x <<
"," << cube.getCorner().y <<
"," << cube.getCorner().z <<
" ) to ("
101 << cube.calcTopFarLeft().x <<
"," << cube.calcTopFarLeft().y <<
"," << cube.calcTopFarLeft().z <<
") size: ("
102 << cube.getDimensions().x <<
"," << cube.getDimensions().y <<
"," << cube.getDimensions().z <<
")"
Data deserializer.
Definition: SerDes.h:573
Data serializer.
Definition: SerDes.h:61