Changeset 10006 in orxonox.OLD for branches/coll_rect/src/lib/collision_reaction/cr_engine.cc
- Timestamp:
- Dec 4, 2006, 2:24:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/coll_rect/src/lib/collision_reaction/cr_engine.cc
r10000 r10006 66 66 PRINTF(0)("CollisionReaction Error: CollisionEvent cache size missmatch: %i of %i\n", this->collisionEventsUnused.size(), CR_MAX_COLLISION_EVENTS); 67 67 68 this-> flushCollisions();68 this->reset(); 69 69 70 70 CollisionIterator it1 = this->collisionsUnused.begin(); … … 121 121 return this->collisionsUsed.back(); 122 122 } 123 else return NULL; 123 else 124 { 125 PRINTF(0)("There is no Collision Object left in the precache table, fatal error will cause segfault, change CR_MAX_COLLISIONS\n"); 126 assert(false); 127 return NULL; 128 } 124 129 } 125 130 … … 136 141 return this->collisionEventsUsed.back(); 137 142 } 138 else return NULL; 143 else 144 { 145 PRINTF(0)("There is no Collision Object left in the precache table, fatal error will cause segfault, change CR_MAX_COLLISION_EVENTS\n"); 146 assert(false); 147 return NULL; 148 } 139 149 } 140 150 … … 147 157 // for all collisions: 148 158 CollisionIterator ci = CollisionTube::getInstance()->begin(); 149 for(; ci < CollisionTube::getInstance()->end(); ++ci)159 for(; ci < CollisionTube::getInstance()->end(); ci++) 150 160 { 151 161 for( int i = CREngine::CR_PHYSICS_MOMENTUM; i < CREngine::CR_NUMBER; i++) … … 153 163 if( _reactionList[i] == NULL) 154 164 continue; 165 166 assert((*ci)->getEntityA() != NULL && (*ci)->getEntityB() != NULL); 167 168 PRINTF(0)("CR CHECK: collision between: %s, %s\n", (*ci)->getEntityA()->getClassName().c_str(), (*ci)->getEntityB()->getClassName().c_str()); 155 169 156 170 // check if entity A or B is subscibed for this event … … 161 175 PRINTF(0)("react to %i\n", i); 162 176 } 163 164 (*ci)->reset();165 177 } 166 } 167 168 this->flushCollisions(); 178 (*ci)->reset(); 179 } 180 181 this->reset(); 169 182 } 170 183 … … 173 186 * flushes all the collision lists and puts them to their initial state 174 187 */ 175 void CREngine:: flushCollisions()188 void CREngine::reset() 176 189 { 177 190 CollisionIterator it1 = this->collisionsUsed.begin(); … … 185 198 this->collisionsUsed.clear(); 186 199 this->collisionEventsUsed.clear(); 200 201 CollisionTube::getInstance()->reset(); 187 202 } 188 203
Note: See TracChangeset
for help on using the changeset viewer.