Changeset 10006 in orxonox.OLD for branches/coll_rect/src/lib/collision_reaction/collision_filter.cc
- Timestamp:
- Dec 4, 2006, 2:24:40 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/coll_rect/src/lib/collision_reaction/collision_filter.cc
r9990 r10006 142 142 bool CollisionFilter::operator()(const WorldEntity& entity) const 143 143 { 144 // if there are no installed criterions just ommit and 145 if( this->isReactive()) 144 PRINTF(0)("operator()(const WorldEntity& entity)\n"); 145 146 // if there are no installed criterions just ommit and return 147 if( !this->isReactive()) 146 148 return false; 147 149 … … 149 151 for( int i = 0; i < CREngine::CR_NUMBER; i++ ) 150 152 { 151 std::vector<ClassID>::const_iterator it = this->_filters[i].begin(); 152 for(; it != this->_filters[i].end(); i++ ) 153 TargetIteratorConst it = this->_filters[i].begin(); 154 for(; it != this->_filters[i].end(); it++ ) 155 { 156 PRINTF(0)("[%i] check %s is a %s?\n", i, entity.getClassName().c_str(), (*it).name().c_str()); 153 157 if( unlikely(entity.isA(*it) ) ) 154 158 return true; 159 } 155 160 } 156 161 … … 168 173 bool CollisionFilter::operator()(const WorldEntity& entity, const CREngine::ReactionType type) const 169 174 { 175 assert(&entity != NULL); 176 177 PRINTF(0)("operator()(const WorldEntity& entity, const CREngine::ReactionType type)\n"); 170 178 // if there are no installed criterions just omit and return 171 179 if( !this->isReactive()) 172 180 return false; 173 181 182 174 183 // goes through all registered filter criterions and looks for matches 175 184 TargetIteratorConst it = this->_filters[type].begin(); 176 185 for(; it != this->_filters[type].end(); it++ ) 177 if( unlikely(entity.isA(*it))) 186 { 187 PRINTF(0)("size: %i - %s is a %s?\n", this->_filters[type].size(), entity.getClassName().c_str(), (*it).name().c_str()); 188 if( entity.isA(*it)) 178 189 return true; 190 } 179 191 180 192 return false;
Note: See TracChangeset
for help on using the changeset viewer.