www.pudn.com > Gimcrack-v0.0051-Source.zip > aabr.h


//////////////////////////////////////////////////// 
// Axis-aligned bounding rectangle 
// 2003-03-15 
//////////////////////////////////////////////////// 
#ifndef _AABR_H_ 
#define _AABR_H_ 
#include "../entity/trsnode.h" 
 
class GcAABR : public GcTRSNode 
{ 
	public: 
		GcAABR(); 
		GcAABR( GcVector3 & v ); 
		GcAABR( GcVector3 & v, GcVector3 & pos ); 
		GcAABR( GcAABR & aabb ); 
		 
		void RenderOutlines(); 
		const bool Intersects( GcAABR * box ); 
 
		void SetExtents( GcVector3 & v ) { m_extents = v; } 
		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() {} 
		 
		//const GcVector3 Center() const { return GcVector3( GetWorldTranslation() ); } 
 
	protected: 
		GcVector3 m_extents; 
		GcVector3 m_orthogonals[3]; 
		 
 
}; 
 
#endif /* _AABR_H_ */