Changeset 10073 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Dec 13, 2006, 10:30:51 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/WorldEntities.am
r10044 r10073 88 88 world_entities/particles/box_emitter.cc \ 89 89 world_entities/particles/plane_emitter.cc \ 90 world_entities/particles/emitter_node.cc \ 90 91 \ 91 92 world_entities/particles/particle_system.cc \ … … 199 200 particles/box_emitter.h \ 200 201 particles/plane_emitter.h \ 202 particles/emitter_node.h \ 201 203 \ 202 204 particles/particle_system.h \ -
branches/playability/src/world_entities/particles/particle_emitter.h
r9869 r10073 36 36 void start(); 37 37 void stop(); 38 v oid tick(float dt);38 virtual void tick(float dt); 39 39 40 40 void setSystem(ParticleSystem* system); … … 74 74 float momentumRandom; //!< The random variation of the Momentum. 75 75 76 private:76 //private: 77 77 ParticleSystem* system; //!< The ParticleSystem this Emitter Emits into. 78 78 float saveTime; //!< The time that was missing by the last Tick (otherwise there would be no emission when framefate is too big). -
branches/playability/src/world_entities/projectiles/mbolt.cc
r10064 r10073 128 128 } 129 129 130 this->setDamage( 50);130 this->setDamage(10); 131 131 this->setHealth(0); 132 132 -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10064 r10073 93 93 { 94 94 SwarmProjectile::trailParticles = new SpriteParticles(2000); 95 SwarmProjectile::trailParticles->setName(" BoomerangProjectileTrailParticles");95 SwarmProjectile::trailParticles->setName("SwarmProjectileTrailParticles"); 96 96 SwarmProjectile::trailParticles->setMaterialTexture("maps/radial-trans-noise.png"); 97 SwarmProjectile::trailParticles->setLifeSpan( 1.0, .3);97 SwarmProjectile::trailParticles->setLifeSpan(.5, 0); 98 98 SwarmProjectile::trailParticles->setRadius(0.0, .5); 99 SwarmProjectile::trailParticles->setRadius(0.2, 2.0);99 SwarmProjectile::trailParticles->setRadius(0.2, 1.5); 100 100 SwarmProjectile::trailParticles->setRadius(.5, 1.0); 101 101 SwarmProjectile::trailParticles->setRadius(1.0, 0.6); … … 108 108 { 109 109 SwarmProjectile::explosionParticles = new SpriteParticles(200); 110 SwarmProjectile::explosionParticles->setName(" BoomerangProjectileExplosionParticles");110 SwarmProjectile::explosionParticles->setName("SwarmProjectileExplosionParticles"); 111 111 SwarmProjectile::explosionParticles->setMaterialTexture("maps/radial-trans-noise.png"); 112 112 SwarmProjectile::explosionParticles->setLifeSpan(.5, .3); … … 123 123 124 124 this->updateNode(0); 125 this->emitter->setEmissionRate( 45.0);125 this->emitter->setEmissionRate(160.0); 126 126 this->emitter->setEmissionVelocity(0.0); 127 127 … … 254 254 this->emitter->setEmissionRate(1000.0); 255 255 this->emitter->setEmissionVelocity(50.0); 256 //this->deactivate();256 this->deactivate(); 257 257 258 258 } -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10064 r10073 32 32 33 33 #include "particles/dot_emitter.h" 34 #include "particles/emitter_node.h" 34 35 #include "particles/sprite_particles.h" 35 36 … … 84 85 { 85 86 this->setPlayer(NULL); 86 delete this->emitter;87 87 } 88 88 … … 144 144 145 145 Weapon* wpRight1 = new LightBlaster (); 146 wpRight1->setName("LightBlaster"); 146 wpRight1->setName( "LightBlaster"); 147 wpRight1->setParent( this); 147 148 Weapon* wpLeft1 = new LightBlaster (); 148 wpLeft1->setName("LightBlaster"); 149 wpLeft1->setName( "LightBlaster"); 150 wpLeft1->setParent( this); 149 151 150 152 Weapon* wpRight2 = new MediumBlaster (); 151 wpRight2->setName("MediumBlaster"); 153 wpRight2->setName( "MediumBlaster"); 154 wpRight2->setParent( this); 152 155 Weapon* wpLeft2 = new MediumBlaster (); 153 wpLeft2->setName("MediumBlaster"); 156 wpLeft2->setName( "MediumBlaster"); 157 wpLeft2->setParent( this); 154 158 155 159 Weapon* wpRight3 = new HeavyBlaster (); 156 wpRight3->setName("HeavyBlaster"); 160 wpRight3->setName( "HeavyBlaster"); 161 wpRight3->setParent( this); 157 162 Weapon* wpLeft3 = new HeavyBlaster (); 158 wpLeft3->setName("HeavyBlaster"); 163 wpLeft3->setName( "HeavyBlaster"); 164 wpLeft3->setParent( this); 159 165 160 166 Weapon* cannon = new SwarmLauncher(); 161 cannon->setName( "SwarmLauncher");162 167 cannon->setName( "SwarmLauncher"); 168 cannon->setParent( this); 163 169 164 170 … … 241 247 registerEvent(EV_MOUSE_MOTION); 242 248 249 this->weaponMan.setParentEntity( this); 250 this->secWeaponMan.setParentEntity( this); 251 243 252 this->weaponMan.setSlotCount(6); 244 253 … … 263 272 this->secWeaponMan.setSlotCount(6); 264 273 265 this->secWeaponMan.setSlotPosition(0, Vector(1.5, -1, 0));274 this->secWeaponMan.setSlotPosition(0, Vector(1.5, 0, 0)); 266 275 this->secWeaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 267 276 268 this->secWeaponMan.setSlotPosition(1, Vector(2.6, .1, 3.0));277 this->secWeaponMan.setSlotPosition(1, Vector(2.6, 0, 3.0)); 269 278 this->secWeaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 270 279 271 this->secWeaponMan.setSlotPosition(2, Vector(1.5, .5, -.5));280 this->secWeaponMan.setSlotPosition(2, Vector(1.5, 0, -.5)); 272 281 this->secWeaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0))); 273 282 274 this->secWeaponMan.setSlotPosition(3, Vector(1.5, .5, .5));283 this->secWeaponMan.setSlotPosition(3, Vector(1.5, 0, .5)); 275 284 this->secWeaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0))); 276 285 277 this->secWeaponMan.setSlotPosition(4, Vector(1.5, -.5, .5));286 this->secWeaponMan.setSlotPosition(4, Vector(1.5, 0, .5)); 278 287 this->secWeaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0))); 279 288 280 this->secWeaponMan.setSlotPosition(5, Vector(1.5, -.5, -.5));289 this->secWeaponMan.setSlotPosition(5, Vector(1.5, 0, -.5)); 281 290 this->secWeaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 282 291 … … 292 301 dynamic_cast<Element2D*>(this->weaponMan.getFixedTarget())->setVisibility( false); 293 302 294 this->burstEmitter = new DotEmitter( 200, 0.0, .01);303 this->burstEmitter = new DotEmitter(800, 0.0, .01); 295 304 this->burstEmitter->setParent(this); 296 305 this->burstEmitter->setRelCoor(-1, .5, 0); 297 306 this->burstEmitter->setName("SpaceShip_Burst_emitter"); 298 this->burstEmitter->setEmissionRate( 200);299 300 this->burstSystem = new SpriteParticles( 1000);307 this->burstEmitter->setEmissionRate(800); 308 309 this->burstSystem = new SpriteParticles(400); 301 310 this->burstSystem->addEmitter(this->burstEmitter); 302 311 this->burstSystem->setName("SpaceShip_Burst_System"); 303 312 ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png"); 304 this->burstSystem->setLifeSpan(0. 4, .3);313 this->burstSystem->setLifeSpan(0.3, .3); 305 314 this->burstSystem->setRadius(0.0, 1.0); 306 315 this->burstSystem->setRadius(0.05, 1.0); 307 316 this->burstSystem->setRadius(.5, .6); 308 317 this->burstSystem->setRadius(1.0, 0); 309 this->burstSystem->setColor(0.0, .7,.7,1,. 7);310 this->burstSystem->setColor(0.2, 0,0,0.8,. 5);318 this->burstSystem->setColor(0.0, .7,.7,1,.5); 319 this->burstSystem->setColor(0.2, 0,0,0.8,.7); 311 320 this->burstSystem->setColor(0.5, .5,.5,.8,.8); 312 321 this->burstSystem->setColor(1.0, .8,.8,.8,.0); 313 314 this->emitter = NULL;315 322 316 323 registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) ); … … 378 385 { 379 386 this->secWeaponMan.hideCrosshair(); 380 this->toList( OM_GROUP_00);387 this->toList( OM_GROUP_00); 381 388 //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false); 382 389 //this->detachCamera(); … … 396 403 */ 397 404 void SpaceShip::leftWorld () 398 {/* 399 this->emitter->stop(); 400 delete this->emitter; 401 delete this->explosionParticles; */ 405 { 406 402 407 } 403 408 … … 573 578 PRINTF(0)("spaceship destroy\n"); 574 579 575 this->explosionParticles = new SpriteParticles(1000); 576 this->explosionParticles->setName("MBoltExplosionParticles"); 577 this->explosionParticles->setLifeSpan(.5, .3); 578 this->explosionParticles->setRadius(0.0, 10.0); 579 this->explosionParticles->setRadius(.5, 6.0); 580 this->explosionParticles->setRadius(1.0, 3.0); 581 this->explosionParticles->setColor(0.0, 1,1,0,.9); 582 this->explosionParticles->setColor(0.5, .8,.8,0,.5); 583 this->explosionParticles->setColor(1.0, .8,.8,.7,.0); 584 585 this->emitter = new DotEmitter(100000, 0, 0); 586 this->emitter->setParent(this); 587 this->emitter->setSpread(M_PI,M_PI); 588 this->emitter->setEmissionRate(50.0); 589 this->emitter->setEmissionVelocity(50.0); 590 591 this->emitter->setSystem(this->explosionParticles); 592 593 this->emitter->setSpread(50); 594 this->emitter->setEmissionRate(50.0); 595 this->emitter->setEmissionVelocity(50.0); 596 this->updateNode(0); 597 598 this->toList(OM_DEAD); 580 EmitterNode* node = NULL; 581 DotEmitter* emitter = NULL; 582 SpriteParticles* explosionParticles = NULL; 583 584 explosionParticles = new SpriteParticles(100); 585 explosionParticles->setName("MBoltExplosionParticles"); 586 explosionParticles->setLifeSpan(.5, .3); 587 explosionParticles->setRadius(0.0, 10.0); 588 explosionParticles->setRadius(.5, 6.0); 589 explosionParticles->setRadius(1.0, 3.0); 590 explosionParticles->setColor(0.0, 1,1,0,.9); 591 explosionParticles->setColor(0.5, .8,.8,0,.5); 592 explosionParticles->setColor(1.0, .8,.8,.7,.0); 593 594 595 emitter = new DotEmitter( 200, 0, 0); 596 emitter->setSpread( M_PI, M_PI); 597 emitter->setSpread( 50); 598 emitter->setEmissionRate( 50.0); 599 emitter->setEmissionVelocity( 150.0); 600 emitter->setSystem( explosionParticles); 601 emitter->setAbsCoor( this->getAbsCoor()); 602 603 node = new EmitterNode( 1); 604 node->setupParticle( emitter, explosionParticles); 605 node->setVelocity( this->getParent()->getVelocity()); 606 node->setAbsCoor( this->getAbsCoor()); 607 node->start(); 608 609 this->setAbsCoor(Vector(-10000,10000,10000)); 610 this->hide(); 611 612 this->toList( OM_DEAD); 613 PRINTF(0)("spaceship destroy == ship translated \n"); 599 614 } 600 615 601 616 void SpaceShip::respawn( ) 602 617 { 603 toList( OM_GROUP_00 ); 618 //this->show(); 619 //this->toList( OM_GROUP_00); 604 620 } 605 621 -
branches/playability/src/world_entities/space_ships/space_ship.h
r10064 r10073 3 3 * Implements the Control of a Spaceship 4 4 * Space Ships are the core class for all types of ships in Orxonox 5 * By default is on OM_GROUP_00 6 * If player boards the ship, it is moved to OM_GROUP_01 5 7 */ 6 8 … … 176 178 ParticleEmitter* burstEmitter; 177 179 ParticleSystem* burstSystem; 178 179 180 SpriteParticles* explosionParticles;181 ParticleEmitter* emitter;182 180 }; 183 181 -
branches/playability/src/world_entities/weapons/swarm_launcher.cc
r10046 r10073 25 25 #include "animation3d.h" 26 26 27 #include <list> 28 #include <iterator> 29 #include "util/state.h" 30 31 #include "math/quaternion.h" 32 27 33 #include "util/loading/factory.h" 28 34 29 35 #include "class_id_DEPRECATED.h" 36 37 using namespace std; 30 38 31 39 ObjectListDefinitionID(SwarmLauncher, CL_SWARM_LAUNCHER); … … 136 144 void SwarmLauncher::fire() 137 145 { 138 Projectile* pj = this->getProjectile(); 139 if (pj == NULL) 140 return; 146 Projectile* pj; 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++); 152 { 153 PRINTF(0)("Iterator step: %i with content: %s\n",++i,*eIterator); 154 if( (dynamic_cast<WorldEntity*>(*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 50000.0) 155 { 156 pj = this->getProjectile(); 157 if (pj == NULL) 158 return; 141 159 142 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 /*+ VECTOR_RAND(13) */ 143 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 144 145 pj->setParent(PNode::getNullParent()); 146 pj->setAbsCoor(this->getEmissionPoint()); 147 pj->setAbsDir(this->getAbsDir()); 148 pj->activate(); 160 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(20))*.5); 161 162 pj->setParent(PNode::getNullParent()); 163 pj->setAbsCoor(this->getEmissionPoint()); 164 pj->setAbsDir(this->getAbsDir()); 165 pj->setTarget( *eIterator); 166 pj->activate(); 167 this->increaseEnergy( pj->getMinEnergy()); 168 } 169 } 170 this->increaseEnergy( - pj->getMinEnergy()); 149 171 } -
branches/playability/src/world_entities/weapons/swarm_launcher.h
r10023 r10073 8 8 9 9 #include "weapon.h" 10 11 #define SWARM_LAUNCHER_MAXRANGE = 500.0; 10 12 11 13 class SwarmLauncher : public Weapon
Note: See TracChangeset
for help on using the changeset viewer.