00001 /*========================================================================= 00002 UberSim Source Code Release 00003 ------------------------------------------------------------------------- 00004 Copyright (C) 2002 Manuela Veloso, Brett Browning, Mike Bowling, 00005 James Bruce; {mmv, brettb, mhb, jbruce}@cs.cmu.edu 00006 Erick Tryzelaar {erickt}@andrew.cmu.edu 00007 School of Computer Science, Carnegie Mellon University 00008 ------------------------------------------------------------------------- 00009 This software is distributed under the GNU General Public License, 00010 version 2. If you do not have a copy of this licence, visit 00011 www.gnu.org, or write: Free Software Foundation, 59 Temple Place, 00012 Suite 330 Boston, MA 02111-1307 USA. This program is distributed 00013 in the hope that it will be useful, but WITHOUT ANY WARRANTY, 00014 including MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00015 -------------------------------------------------------------------------*/ 00016 00017 #ifndef __SIM_GEOMETRY_H__ 00018 #define __SIM_GEOMETRY_H__ 00019 00020 #include "nommgr.h" 00021 #include <ode/ode.h> 00022 #include "mmgr.h" 00023 00024 #include "Spatial.h" 00030 class CollisionController; 00031 00032 class Geometry : public Spatial 00033 { 00034 public: 00035 Geometry (char* name = "Geometry"); 00036 virtual ~Geometry (); 00037 00038 public: 00039 CollisionController* getCollisionController (); 00040 dGeomID& getGeometry (); 00041 BoundingSphere& getModelBound (); 00042 00043 void setCollisionController (CollisionController* collisionController); 00044 00045 void setGeometry (const dGeomID& geometry); 00046 void setModelBound (const BoundingSphere& boundingSphere); 00047 void setColor (const Vector3& color); 00048 void setAABBShowMode(bool mode); 00049 bool getAABBShowMode(); 00050 00051 public: 00052 virtual void updateWorldData (Real deltaTime); 00053 virtual void updateWorldBound (); 00054 virtual void draw (); 00055 virtual void print (); 00056 virtual void collidingWith (Spatial* object); 00057 00058 protected: 00059 CollisionController* collisionController; 00060 00061 BoundingSphere modelBound; 00062 static bool show_aabb; 00063 dGeomID geometry; 00064 Vector3 color; 00065 }; 00066 00067 #endif