X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FAabb.hh;fp=src%2FMoof%2FAabb.hh;h=457d198495e9a358fd40e304b3236730e501af57;hp=f51531a49d49db13e1fd3f87b77510c59ed747c4;hb=72d4af22710317acffab861421c4364b1780b6fe;hpb=493ddb59a8620b49dfa0ff62ce93395ebfd02e86 diff --git a/src/Moof/Aabb.hh b/src/Moof/Aabb.hh index f51531a..457d198 100644 --- a/src/Moof/Aabb.hh +++ b/src/Moof/Aabb.hh @@ -32,6 +32,7 @@ #include #include #include +#include namespace Mf { @@ -104,6 +105,36 @@ struct Aabb : public Cullable, public Drawable (min[2] + max[2]) / 2.0); } + void getOctant(Aabb& octant, int num) const; + + inline Plane getPlaneXY() const + { + Plane plane; + plane.normal = Vector3(0.0, 0.0, 1.0); + plane.d = cml::dot(-plane.normal, getCenter()); + return plane; + } + + inline Plane getPlaneXZ() const + { + Plane plane; + plane.normal = Vector3(0.0, 1.0, 0.0); + plane.d = cml::dot(-plane.normal, getCenter()); + return plane; + } + + inline Plane getPlaneYZ() const + { + Plane plane; + plane.normal = Vector3(1.0, 0.0, 0.0); + plane.d = cml::dot(-plane.normal, getCenter()); + return plane; + } + + void getCorners(Vector3 corners[8]) const; + + void encloseVertices(const Vector3 vertices[], unsigned count); + void draw(Scalar alpha = 0.0) const; bool isVisible(const Camera& cam) const; };