Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2006, 10:30:51 PM (18 years ago)
Author:
marcscha
Message:

Emitter Node implemented, first steps for swarm missile in

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  
    3232
    3333#include "particles/dot_emitter.h"
     34#include "particles/emitter_node.h"
    3435#include "particles/sprite_particles.h"
    3536
     
    8485{
    8586  this->setPlayer(NULL);
    86   delete this->emitter;
    8787}
    8888
     
    144144
    145145  Weapon* wpRight1 = new LightBlaster ();
    146   wpRight1->setName("LightBlaster");
     146  wpRight1->setName( "LightBlaster");
     147  wpRight1->setParent( this);
    147148  Weapon* wpLeft1 = new LightBlaster ();
    148   wpLeft1->setName("LightBlaster");
     149  wpLeft1->setName( "LightBlaster");
     150  wpLeft1->setParent( this);
    149151
    150152  Weapon* wpRight2 = new MediumBlaster ();
    151   wpRight2->setName("MediumBlaster");
     153  wpRight2->setName( "MediumBlaster");
     154  wpRight2->setParent( this);
    152155  Weapon* wpLeft2 = new MediumBlaster ();
    153   wpLeft2->setName("MediumBlaster");
     156  wpLeft2->setName( "MediumBlaster");
     157  wpLeft2->setParent( this);
    154158
    155159  Weapon* wpRight3 = new HeavyBlaster ();
    156   wpRight3->setName("HeavyBlaster");
     160  wpRight3->setName( "HeavyBlaster");
     161  wpRight3->setParent( this);
    157162  Weapon* wpLeft3 = new HeavyBlaster ();
    158   wpLeft3->setName("HeavyBlaster");
     163  wpLeft3->setName( "HeavyBlaster");
     164  wpLeft3->setParent( this);
    159165
    160166  Weapon* cannon = new SwarmLauncher();
    161   cannon->setName("SwarmLauncher");
    162  
     167  cannon->setName( "SwarmLauncher");
     168  cannon->setParent( this);
    163169
    164170
     
    241247  registerEvent(EV_MOUSE_MOTION);
    242248
     249  this->weaponMan.setParentEntity( this);
     250  this->secWeaponMan.setParentEntity( this);
     251
    243252  this->weaponMan.setSlotCount(6);
    244253
     
    263272  this->secWeaponMan.setSlotCount(6);
    264273
    265   this->secWeaponMan.setSlotPosition(0, Vector(1.5, -1, 0));
     274  this->secWeaponMan.setSlotPosition(0, Vector(1.5, 0, 0));
    266275  this->secWeaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    267276
    268   this->secWeaponMan.setSlotPosition(1, Vector(2.6, .1, 3.0));
     277  this->secWeaponMan.setSlotPosition(1, Vector(2.6, 0, 3.0));
    269278  this->secWeaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    270279
    271   this->secWeaponMan.setSlotPosition(2, Vector(1.5, .5, -.5));
     280  this->secWeaponMan.setSlotPosition(2, Vector(1.5, 0, -.5));
    272281  this->secWeaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
    273282
    274   this->secWeaponMan.setSlotPosition(3, Vector(1.5, .5, .5));
     283  this->secWeaponMan.setSlotPosition(3, Vector(1.5, 0, .5));
    275284  this->secWeaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
    276285
    277   this->secWeaponMan.setSlotPosition(4, Vector(1.5, -.5, .5));
     286  this->secWeaponMan.setSlotPosition(4, Vector(1.5, 0, .5));
    278287  this->secWeaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
    279288
    280   this->secWeaponMan.setSlotPosition(5, Vector(1.5, -.5, -.5));
     289  this->secWeaponMan.setSlotPosition(5, Vector(1.5, 0, -.5));
    281290  this->secWeaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    282291
     
    292301  dynamic_cast<Element2D*>(this->weaponMan.getFixedTarget())->setVisibility( false);
    293302
    294   this->burstEmitter = new DotEmitter(200, 0.0, .01);
     303  this->burstEmitter = new DotEmitter(800, 0.0, .01);
    295304  this->burstEmitter->setParent(this);
    296305  this->burstEmitter->setRelCoor(-1, .5, 0);
    297306  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);
    301310  this->burstSystem->addEmitter(this->burstEmitter);
    302311  this->burstSystem->setName("SpaceShip_Burst_System");
    303312  ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png");
    304   this->burstSystem->setLifeSpan(0.4, .3);
     313  this->burstSystem->setLifeSpan(0.3, .3);
    305314  this->burstSystem->setRadius(0.0, 1.0);
    306315  this->burstSystem->setRadius(0.05, 1.0);
    307316  this->burstSystem->setRadius(.5, .6);
    308317  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);
    311320  this->burstSystem->setColor(0.5, .5,.5,.8,.8);
    312321  this->burstSystem->setColor(1.0, .8,.8,.8,.0);
    313 
    314   this->emitter = NULL;
    315322
    316323  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
     
    378385{
    379386  this->secWeaponMan.hideCrosshair();
    380   this->toList(OM_GROUP_00);
     387  this->toList( OM_GROUP_00);
    381388  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false);
    382389  //this->detachCamera();
     
    396403*/
    397404void SpaceShip::leftWorld ()
    398 {/*
    399   this->emitter->stop();
    400   delete this->emitter;
    401   delete this->explosionParticles; */
     405{
     406
    402407}
    403408
     
    573578  PRINTF(0)("spaceship destroy\n");
    574579
    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");
    599614}
    600615
    601616void SpaceShip::respawn( )
    602617{
    603   toList( OM_GROUP_00 );
     618  //this->show();
     619  //this->toList( OM_GROUP_00);
    604620}
    605621
  • branches/playability/src/world_entities/space_ships/space_ship.h

    r10064 r10073  
    33 * Implements the Control of a Spaceship
    44 * 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
    57 */
    68
     
    176178    ParticleEmitter*      burstEmitter;
    177179    ParticleSystem*       burstSystem;
    178 
    179    
    180     SpriteParticles*           explosionParticles;
    181     ParticleEmitter*           emitter;
    182180};
    183181
Note: See TracChangeset for help on using the changeset viewer.