Changeset 9892 in orxonox.OLD for branches/coll_rect/src/lib/collision_reaction/cr_engine.cc
- Timestamp:
- Oct 14, 2006, 1:25:47 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/coll_rect/src/lib/collision_reaction/cr_engine.cc
r9890 r9892 89 89 90 90 /** 91 * @returns an instance to a collision object. instead of creating new object this ones can be resycled 92 */ 93 Collision* CREngine::popCollisionObject() 94 { 95 if( !this->collisionsUnused.empty()) 96 { 97 this->collisionsUsed.push_back(this->collisionsUnused.back()); 98 this->collisionsUnused.pop_back(); 99 return this->collisionsUsed.back(); 100 } 101 else return NULL; 102 } 103 104 /** 105 * @return an instanco of a CollisionEvent object. instead of creating a new object this ones can be used and resycled 106 */ 107 CollisionEvent* CREngine::popCollisionEventObject() 108 { 109 if( !this->collisionEventsUnused.empty()) 110 { 111 this->collisionEventsUsed.push_back(this->collisionEventsUnused.back()); 112 this->collisionEventsUnused.pop_back(); 113 return this->collisionEventsUsed.back(); 114 } 115 else return NULL; 116 } 117 118 119 /** 91 120 * flushes the CollisionHandles and restores the CREngine to the initial state 92 121 */ … … 112 141 * @return the newly created CollisionHandle 113 142 */ 114 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type)143 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, ReactionType type) 115 144 { 116 145 CollisionHandle* ch = new CollisionHandle(owner, type);
Note: See TracChangeset
for help on using the changeset viewer.