Changeset 9895 in orxonox.OLD for branches/coll_rect/src/lib/collision_reaction/cr_engine.cc
- Timestamp:
- Oct 19, 2006, 3:54:49 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/coll_rect/src/lib/collision_reaction/cr_engine.cc
r9893 r9895 20 20 #include "collision.h" 21 21 #include "collision_event.h" 22 #include "collision_ handle.h"22 #include "collision_filter.h" 23 23 #include "cr_defs.h" 24 24 … … 122 122 void CREngine::reset() 123 123 { 124 // first clear all CollisionHandles125 std::vector<CollisionHandle*>::iterator it = this->collisionHandles.begin();126 for(; it < this->collisionHandles.end(); it++)127 {128 (*it)->reset();129 delete *it;130 }131 132 this->collisionHandles.clear();124 // // first clear all CollisionHandles 125 // std::vector<CollisionHandle*>::iterator it = this->collisionHandles.begin(); 126 // for(; it < this->collisionHandles.end(); it++) 127 // { 128 // (*it)->reset(); 129 // delete *it; 130 // } 131 // 132 // this->collisionHandles.clear(); 133 133 } 134 134 … … 140 140 * @return the newly created CollisionHandle 141 141 */ 142 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, ReactionType type)143 {144 CollisionHandle* ch = new CollisionHandle(owner, type);145 this->collisionHandles.push_back(ch);146 147 return ch;148 }142 // CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, ReactionType type) 143 // { 144 // CollisionHandle* ch = new CollisionHandle(owner, type); 145 // this->collisionHandles.push_back(ch); 146 // 147 // return ch; 148 // } 149 149 150 150 … … 154 154 * @param returns true if worked collrectly 155 155 */ 156 bool CREngine::unsubscribeReaction(CollisionHandle* collisionHandle)157 {158 std::vector<CollisionHandle*>::iterator it;159 for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)160 {161 if( *it == collisionHandle)162 {163 this->collisionHandles.erase(it);164 delete collisionHandle;165 return true;166 }167 }168 return false;169 }156 // bool CREngine::unsubscribeReaction(CollisionHandle* collisionHandle) 157 // { 158 // std::vector<CollisionHandle*>::iterator it; 159 // for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++) 160 // { 161 // if( *it == collisionHandle) 162 // { 163 // this->collisionHandles.erase(it); 164 // delete collisionHandle; 165 // return true; 166 // } 167 // } 168 // return false; 169 // } 170 170 171 171 … … 175 175 void CREngine::handleCollisions() 176 176 { 177 std::vector<CollisionHandle*>::iterator it;178 for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)179 {180 if( !(*it)->isDispatched() || (*it)->isContinuousPoll()) //does it have any collisions to report at all181 {182 (*it)->handleCollisions();183 }184 }185 this->flushCollisions();177 // std::vector<CollisionHandle*>::iterator it; 178 // for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++) 179 // { 180 // if( !(*it)->isDispatched() || (*it)->isContinuousPoll()) //does it have any collisions to report at all 181 // { 182 // (*it)->handleCollisions(); 183 // } 184 // } 185 // this->flushCollisions(); 186 186 } 187 187
Note: See TracChangeset
for help on using the changeset viewer.