www.pudn.com > Gimcrack-v0.0051-Source.zip > aabb.h
////////////////////////////////////////////////////
// Axis-aligned bounding box
// 2003-03-15
////////////////////////////////////////////////////
#ifndef _AABB_H_
#define _AABB_H_
#include "../entity/trsnode.h"
//#include "plane.h"
class GcAABB : public GcTRSNode
{
public:
GcAABB();
GcAABB( GcVector3 & v );
GcAABB( GcVector3 & v, GcVector3 & pos );
GcAABB( GcAABB & aabb );
void RenderOutlines();
const bool Intersects( GcAABB * box );
// const bool Intersects( GcPlane & plane );
inline const bool Intersects( GcAABB & plane ); // FIXME: Make param const
void SetExtents( GcVector3 & v );
std::string Info();
float Extent( int i ) { return m_extents[i]; }
const GcVector3 & GetExtent() const { return m_extents; }
GcVector3 & GetExtents() { return m_extents; }
GcVector3 * GetOrthogonals() { return m_orthogonals; }
GcVector3 & GetOrthogonal( int i ) { return m_orthogonals[i]; }
void Render() {}
GcVector3 Point( int i );
//const GcVector3 Center() const { return GcVector3( GetWorldTranslation() ); }
protected:
GcVector3 m_extents;
GcVector3 m_orthogonals[3];
GcVector3 m_points[8];
};
#endif /* _AABB_H_ */