Changeset 7932 in orxonox.OLD for branches/cr
- Timestamp:
- May 28, 2006, 9:00:40 PM (19 years ago)
- Location:
- branches/cr/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/collision_handle.cc
r7927 r7932 16 16 17 17 #include "collision_handle.h" 18 19 20 18 21 19 22 using namespace std; … … 41 44 // delete what has to be deleted here 42 45 } 46 47 48 /** 49 * add more filter targets to this collision handle 50 * @param classID the classid to look for 51 */ 52 void CollisionHandle::addTarget(long classID) 53 { 54 // make sure there is no dublicate 55 std::vector<long>::iterator it; 56 for( it = this->targetList.begin(); it != this->targetList.end(); it++) 57 if(*it == classID) 58 return; 59 60 // add element 61 this->targetList.push_back(classID); 62 } -
branches/cr/src/lib/collision_reaction/collision_handle.h
r7927 r7932 27 27 28 28 29 void addTarget( );29 void addTarget(long classID); 30 30 31 31 void registerCollision(Collision* collision); -
branches/cr/src/lib/collision_reaction/cr_engine.cc
r7927 r7932 47 47 48 48 49 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type , int nrOfTargets, ...)49 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type) 50 50 { 51 51 52 va_list itemlist;53 va_start (itemlist, type);54 // for (int i = 0; i < nrOfTargets; i++)55 // this->targetList.push_back(va_arg(itemlist, int));56 va_end(itemlist);57 52 } 58 53 -
branches/cr/src/lib/collision_reaction/cr_engine.h
r7927 r7932 41 41 inline static CREngine* getInstance(void) { if (!singletonRef) singletonRef = new CREngine(); return singletonRef; }; 42 42 43 44 CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type, int nrOfTargets, ...); 43 CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type); 45 44 46 45 bool unsubscribeReaction(WorldEntity* worldEntity); … … 51 50 52 51 /** @returns an instance to a collision object. instead of creating new object this ones can be resycled */ 53 inline Collision* getCollisionObject() { /* return the first element of the cache list*/ }52 inline Collision* getCollisionObject() { /* return the first element of the cache list*/ } 54 53 /** @param collision: returns the Collision object back to the cache list */ 55 54 inline void putCollisionObject(Collision* collision) { this->cachedCollisions.push_back(collision); } -
branches/cr/src/world_entities/world_entity.cc
r7927 r7932 69 69 70 70 this->toList(OM_NULL); 71 72 //this->collisionHandles = new *CollisionHandle[CREngine::CR_NUMBER]();73 71 } 74 72 … … 242 240 */ 243 241 void WorldEntity::subscribeReaction(CREngine::CRType type, int nrOfTargets, ...) 244 {} 242 { 243 244 this->collisionHandles[type] = CREngine::getInstance()->subscribeReaction(this, type); 245 246 va_list itemlist; 247 va_start (itemlist, CREngine::CRType); 248 for (int i = 0; i < nrOfTargets; i++) 249 this->collisionHandles[type].push_back(va_arg(itemlist, long)); 250 va_end(itemlist); 251 } 245 252 246 253 -
branches/cr/src/world_entities/world_entity.h
r7927 r7932 130 130 bool bVisible; //!< If it should be visible. 131 131 132 OM_LIST objectListNumber; //!< The ObjectList from ObjectManager this Entity is in.133 ObjectManager::EntityList::iterator objectListIterator; //!< The iterator position of this Entity in the given list of the ObjectManager.132 OM_LIST objectListNumber; //!< The ObjectList from ObjectManager this Entity is in. 133 ObjectManager::EntityList::iterator objectListIterator; //!< The iterator position of this Entity in the given list of the ObjectManager. 134 134 135 float scaling; 136 CollisionHandle* * collisionHandles;135 float scaling; //!< the scaling of the model 136 CollisionHandle* collisionHandles[CREngine::CR_NUMBER]; //!< the list of the collision reactions 137 137 138 138
Note: See TracChangeset
for help on using the changeset viewer.