aabb.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004-2006 by Reality Rift Studios                       *
00003  *   http://www.realityrift.com  -  mattias@realityrift.com                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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

Generated on Sat Feb 17 20:50:47 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1