Changeset 10078 in orxonox.OLD for branches/playability/src/world_entities/weapons/swarm_launcher.cc
- Timestamp:
- Dec 14, 2006, 10:58:41 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/weapons/swarm_launcher.cc
r10077 r10078 145 145 { 146 146 Projectile* pj = NULL; 147 int i = 0; 148 std::list<WorldEntity*> eList = State::getObjectManager()->getEntityList( OM_GROUP_00); 149 list<WorldEntity*>::iterator eIterator; 150 PRINTF(0)("Iterator output: %i\n",eList.size()); 151 for( eIterator = eList.begin(); eIterator != eList.end(); eIterator++); 147 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 152 148 { 153 PRINTF(0)("Iterator step: %i with content: %s\n",++i,*eIterator); 154 if( (dynamic_cast<WorldEntity*>(*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 50000.0) 149 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 100) 155 150 { 156 151 pj = this->getProjectile(); 157 152 if (pj == NULL) 158 153 return; 159 160 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(20))*.5); 154 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(20))); 161 155 162 pj->setParent( PNode::getNullParent());163 pj->setAbsCoor( this->getEmissionPoint());164 pj->setAbsDir( this->getAbsDir());156 pj->setParent( PNode::getNullParent()); 157 pj->setAbsCoor( this->getEmissionPoint()); 158 pj->setAbsDir( this->getAbsDir()); 165 159 pj->setTarget( *eIterator); 166 160 pj->activate(); 167 this->increaseEnergy( pj->getMinEnergy());168 161 } 169 162 } 170 this->increaseEnergy( - pj->getMinEnergy());171 163 }
Note: See TracChangeset
for help on using the changeset viewer.