Changeset 10073 in orxonox.OLD for branches/playability/src/world_entities/space_ships
- Timestamp:
- Dec 13, 2006, 10:30:51 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.