00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef neo_collision_aabb_h
00022 #define neo_collision_aabb_h
00023
00029 #include "../core/platform.h"
00030
00031 #if NEO_ENABLE_COLLISION
00032
00033 #include "volume.h"
00034
00035 namespace neo {
00036 namespace collision {
00037
00039
00041 class AABB : public Volume
00042 {
00043 public:
00044
00046
00047 inline AABB( const math::Vector3& dim = math::Vector3::ZERO );
00048
00050
00055 inline AABB( const math::Vector3& globalTrans, const math::Vector3& localTrans, const math::Quaternion& globalRot, const math::Quaternion& localRot, const math::Vector3& dim );
00056
00058 inline virtual ~AABB() {}
00059
00061
00062 inline const math::Vector3& getDimension() const;
00063
00065
00066 inline void setDimension( const math::Vector3& dim );
00067
00068 virtual bool intersect( const math::Vector3& point, bool earlyout = true ) const;
00069 virtual bool intersect( const AABB* p_volume, bool earlyout = true ) const;
00070 virtual bool intersect( const OBB* p_volume, bool earlyout = true ) const;
00071 virtual bool intersect( const Sphere* p_volume, bool earlyout = true ) const;
00072 virtual bool collision( const math::Vector3& point, const math::Vector3& direction, ContactSet* p_set, float tmax ) const;
00073
00074 virtual void scale( float factor );
00075
00076 virtual Volume* clone() const;
00077
00079
00081 AABB& operator = ( const AABB& aabb );
00082
00083 protected:
00084
00086 math::Vector3 _dim;
00087
00088 friend class OBB;
00089 };
00090
00091 #define neo_collision_aabb_def
00092
00093 #include "aabb.inl"
00094 #include "volume.inl"
00095
00096 }
00097 }
00098
00099 #endif
00100
00101 #endif