Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10078 in orxonox.OLD for branches/playability


Ignore:
Timestamp:
Dec 14, 2006, 10:58:41 AM (18 years ago)
Author:
marcscha
Message:

Update in swarm launcher, swarm missile, mbolt

Location:
branches/playability/src/world_entities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/particles/emitter_node.cc

    r10077 r10078  
    4646{
    4747  this->emitter->setSystem(NULL);
    48   delete this->emitter;
     48  this->removeNode();
    4949}
    5050
     
    6161}
    6262
    63 void EmitterNode::start()
     63bool EmitterNode::start()
    6464{
    65    this->started  = true;
     65  this->started  = true;
     66  return this->started;
    6667}
    6768
     
    7677    this->removeNode();
    7778  }
     79  PRINTF(0)("Coordinate Update EmitterNode: (%f,%f,%f) -> (%f,%f,%f)\n",this->getAbsCoor().x,this->getAbsCoor().y,this->getAbsCoor().z,this->velocity.x,this->velocity.y,this->velocity.z);
    7880  this->setAbsCoor(this->getAbsCoor() + (this->velocity * dt));
    7981}
  • branches/playability/src/world_entities/particles/emitter_node.h

    r10077 r10078  
    2828  virtual void tick( float time);
    2929
    30   void start();
     30  bool start();
    3131  inline void setVelocity(Vector velocity) { this->velocity = velocity;};
    3232
  • branches/playability/src/world_entities/projectiles/mbolt.cc

    r10073 r10078  
    4545{
    4646  this->registerObject(this, MBolt::_objectList);
    47   this->loadModel("models/projectiles/mbolt.obj",0.25);
     47  this->loadModel("models/projectiles/mbolt.obj");
     48 
    4849  //this->loadModel("models/projectiles/laser.obj");
    4950
     
    5556
    5657  //this->emitter = new DotEmitter(1000, 0, 0);
    57   this->emitter = new BoxEmitter(Vector(8,1,1)*dynamic_cast<StaticModel*>(this->getModel())->getScaleFactor(), 1000, 0, 0);
     58  this->emitter = new DotEmitter(200, 0, 0);
    5859  this->emitter->setParent(this);
    5960  this->emitter->setSpread(M_PI,M_PI);
     
    7677/**
    7778 *  standard deconstructor
    78 
    79 /**
    80 */
     79 *
     80 */
    8181MBolt::~MBolt ()
    8282{
     
    104104  if (unlikely(MBolt::trailParticles == NULL))
    105105  {
    106     MBolt::trailParticles = new SpriteParticles(3000);
     106    MBolt::trailParticles = new SpriteParticles(1000);
    107107    MBolt::trailParticles->setName("BoomerangProjectileTrailParticles");
    108108    MBolt::trailParticles->setMaterialTexture("maps/radial-trans-noise.png");
     
    134134
    135135  this->emitter->setSpread(0);
    136   this->emitter->setEmissionRate(80.0);
     136  this->emitter->setEmissionRate(10.0);
    137137  this->emitter->setEmissionVelocity(0);
    138138  this->updateNode(0);
     
    198198
    199199  glPushMatrix();
    200 
    201200  float matrix[4][4];
    202201  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     
    205204  glMultMatrixf((float*)matrix);
    206205
    207   glScalef(3.0, 0.7, 0.7);  // no double rescale
     206  glScalef(0.75, 0.7/4, 0.7/4);  // no double rescale
    208207
    209208  this->mat->select();
  • branches/playability/src/world_entities/projectiles/swarm_projectile.cc

    r10073 r10078  
    9595    SwarmProjectile::trailParticles->setName("SwarmProjectileTrailParticles");
    9696    SwarmProjectile::trailParticles->setMaterialTexture("maps/radial-trans-noise.png");
    97     SwarmProjectile::trailParticles->setLifeSpan(.5, 0);
    98     SwarmProjectile::trailParticles->setRadius(0.0, .5);
    99     SwarmProjectile::trailParticles->setRadius(0.2, 1.5);
    100     SwarmProjectile::trailParticles->setRadius(.5, 1.0);
    101     SwarmProjectile::trailParticles->setRadius(1.0, 0.6);
     97    SwarmProjectile::trailParticles->setLifeSpan(.3, 0);
     98    SwarmProjectile::trailParticles->setRadius(0.0, .7);
     99    SwarmProjectile::trailParticles->setRadius(0.2, 1.3);
     100    SwarmProjectile::trailParticles->setRadius(.5, .8);
     101    SwarmProjectile::trailParticles->setRadius(1.0, 0.3);
    102102    SwarmProjectile::trailParticles->setColor(0.0, 1,0,0,.7);
    103103    SwarmProjectile::trailParticles->setColor(0.2, .8,.8,0,.5);
     
    123123
    124124  this->updateNode(0);
    125   this->emitter->setEmissionRate(160.0);
     125  this->emitter->setEmissionRate(50.0);
    126126  this->emitter->setEmissionVelocity(0.0);
     127  this->emitter->setInheritSpeed(0);
    127128
    128129  this->setHealth(10.0* (float)rand()/(float)RAND_MAX);
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10073 r10078  
    377377  this->secWeaponMan.showCrosshair();
    378378  this->toList( OM_GROUP_01 );
     379  /*for(ObjectList<WorldEntity>::const_iterator it = WorldEntity::objectList().begin(); it != WorldEntity::objectList().end(); it++)
     380  {
     381    (*it)->toList( OM_GROUP_01);
     382  }*/
    379383  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( true);
    380384  //this->attachCamera();
     
    386390  this->secWeaponMan.hideCrosshair();
    387391  this->toList( OM_GROUP_00);
     392  /*for(ObjectList<WorldEntity>::const_iterator it = WorldEntity::objectList().begin(); it != WorldEntity::objectList().end(); it++)
     393  {
     394    (*it)->toList( OM_GROUP_00);
     395  }*/
    388396  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false);
    389397  //this->detachCamera();
     
    611619
    612620  this->toList( OM_DEAD);
     621  /*for(ObjectList<WorldEntity>::const_iterator it = WorldEntity::objectList().begin(); it != WorldEntity::objectList().end(); it++)
     622  {
     623    (*it)->toList( OM_DEAD);
     624  }*/
    613625    PRINTF(0)("spaceship destroy == ship translated \n");
    614626}
  • branches/playability/src/world_entities/space_ships/space_ship.h

    r10073 r10078  
    147147
    148148    Vector                velocity;           //!< the velocity of the player.
     149    Vector                oldPos;
    149150
    150151// 2D-traveling
  • branches/playability/src/world_entities/weapons/swarm_launcher.cc

    r10077 r10078  
    145145{
    146146  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++)
    152148  {
    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)
    155150    {
    156151      pj  = this->getProjectile();
    157152      if (pj == NULL)
    158153        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)));
    161155       
    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());
    165159          pj->setTarget( *eIterator);
    166160          pj->activate();
    167       this->increaseEnergy( pj->getMinEnergy());
    168161    }
    169162  }
    170   this->increaseEnergy( - pj->getMinEnergy());
    171163}
Note: See TracChangeset for help on using the changeset viewer.