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 __COLLIDER_H__ 00018 #define __COLLIDER_H__ 00019 00020 #include "nommgr.h" 00021 #include <vector> 00022 #include "mmgr.h" 00028 class CollisionGroup; 00029 class Geometry; 00030 class Node; 00031 class Spatial; 00032 00033 class CollisionManager 00034 { 00035 public: 00036 static CollisionManager* getInstance (); 00037 00038 public: 00039 virtual ~CollisionManager (); 00040 00041 public: 00042 void initialize (); 00043 void shutdown (); 00044 00045 public: 00046 void beginFrame (); 00047 void frame (); 00048 void endFrame (); 00049 00050 public: 00051 int addCollisionGroup (CollisionGroup* collisionGroup); 00052 CollisionGroup* removeCollisionGroup (unsigned int i); 00053 void removeCollisionGroup (CollisionGroup* collisionGroup); 00054 00055 public: 00056 void addCollision (Geometry* geometry1, Spatial* spatial2); 00057 void addCollision (Geometry* geometry1, Geometry* geometry2); 00058 00059 protected: 00060 CollisionManager (); 00061 00062 protected: 00063 bool isInitialized; 00064 bool isShutdown; 00065 00066 std::vector<CollisionGroup*> collisionGroups; 00067 }; 00068 00069 #endif