Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6756 in orxonox.OLD


Ignore:
Timestamp:
Jan 26, 2006, 1:55:40 AM (19 years ago)
Author:
bensch
Message:

trunk: Burst Particles

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/hud.cc

    r6671 r6756  
    154154  std::list<GLGuiWidget*>::iterator weaponWidget;
    155155  float pos = .2;
    156   bool test = true;
    157   for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos+=.03, test = !test)
     156  for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos+=.03)
    158157  {
    159     if (test)
    160     {
    161158      (*weaponWidget)->setSize2D(.02*this->resX, .2 *this->resY);
    162159      (*weaponWidget)->setAbsCoor2D(pos*this->resX, .75*this->resY);
    163     }
    164     else
    165     {
    166       (*weaponWidget)->setSize2D(.02*this->resX, .17*this->resY);
    167       (*weaponWidget)->setAbsCoor2D((pos-.008)*this->resX, .75*this->resY);
    168     }
     160
    169161  }
    170162}
  • trunk/src/world_entities/environments/water.cc

    r6695 r6756  
    180180           4 * this->grid->height(i, j);
    181181      this->velocities[i][j] += dt * this->viscosity * this->viscosity * u / this->height;
    182       this->grid->height(i, j) += dt * this->velocities[i][j];
     182      this->grid->height(i, j) += dt * this->velocities[i][j] + dt * this->cohesion * u / this->height;;
    183183    }
    184184  }
     
    194194    this->grid->height(i,this->grid->columns()-1) = this->grid->height(i, this->grid->columns()-2);
    195195  }
    196   /*  // advect
    197     for(j = 1; j < this->grid->rows() - 1; j++) {
     196  /*
     197  for(j = 1; j < this->grid->rows() - 1; j++) {
    198198      for(i = 1; i < this->grid->columns() - 1; i++) {
    199199        this->grid->height(i, j) += dt * this->velocities[i][j];
    200200      }
    201201    }*/
    202   // bound
    203   //   unsigned int w = this->grid->columns - 1;
    204   //   for(i = 0; i < this->grid->columns; i++) {
    205   //     _map[i][0].u[1] = _map[i][1  ].u[1];
    206   //     _map[i][w].u[1] = _map[i][w-1].u[1];
    207   //     _map[0][i].u[1] = _map[1  ][i].u[1];
    208   //     _map[w][i].u[1] = _map[w-1][i].u[1];
    209   //   }
    210 
    211   // diffusion
    212   for(j = 1; j < this->grid->rows() - 1; j++)
    213   {
    214     for(i = 1; i < this->grid->columns() - 1 ; i++)
    215     {
    216       u = this->grid->height(i+1, j) + this->grid->height(i-1, j) +
    217           this->grid->height(i, j+1) + this->grid->height(i, j-1) -
    218           4* this->grid->height(i, j);
    219       this->grid->height(i,j) += dt * this->cohesion * u / this->height;
    220     }
    221   }
    222202
    223203  // calc normals
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6753 r6756  
    2727#include "weapons/turret.h"
    2828#include "weapons/cannon.h"
     29
     30#include "particle_emitter.h"
     31#include "sprite_particles.h"
    2932
    3033#include "factory.h"
     
    210213
    211214  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     215
     216  this->burstEmitter = new ParticleEmitter(Vector(-1,0,0), 1, 200, 0.0);
     217  this->burstEmitter->setParent(this);
     218  this->burstEmitter->setName("SpaceShip_Burst_emitter");
     219
     220
     221  this->burstSystem = new SpriteParticles(1000);
     222  this->burstSystem->addEmitter(this->burstEmitter);
     223  this->burstSystem->setName("SpaceShip_Burst_System");
     224  ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png");
     225  this->burstSystem->setLifeSpan(1.0, .3);
     226  this->burstSystem->setRadius(0.0, 2.0);
     227  this->burstSystem->setRadius(0.05, 3.0);
     228  this->burstSystem->setRadius(.5, .8);
     229  this->burstSystem->setRadius(1.0, .8);
     230  this->burstSystem->setColor(0.0, 1,0,0,.7);
     231  this->burstSystem->setColor(0.2, .8,.8,0,.5);
     232  this->burstSystem->setColor(0.5, .8,.8,.8,.8);
     233  this->burstSystem->setColor(1.0, .8,.8,.8,.0);
     234
    212235}
    213236
     
    219242void SpaceShip::loadParams(const TiXmlElement* root)
    220243{
    221   WorldEntity::loadParams(root);
     244  Playable::loadParams(root);
    222245}
    223246
     
    315338  velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
    316339  velocity = (velocity.getNormalized())*travelSpeed;
     340  this->burstEmitter->setEmissionRate(travelSpeed);
    317341
    318342  //orient the spaceship in direction of the mouse
  • trunk/src/world_entities/space_ships/space_ship.h

    r6737 r6756  
    1010#include "extendable.h"
    1111
    12 
     12// Forward Declaration
    1313template<class T> class tList;
    1414class Vector;
    1515class Event;
     16class ParticleEmitter;
     17class ParticleSystem;
    1618
    1719class SpaceShip : public Playable
     
    8385    int oldMask;
    8486
     87    ParticleEmitter*      burstEmitter;
     88    ParticleSystem*       burstSystem;
    8589};
    8690
  • trunk/src/world_entities/weapons/weapon.cc

    r6736 r6756  
    8686  this->soundSource = new SoundSource(this);       //< Every Weapon has exacty one SoundSource.
    8787  this->emissionPoint.setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
     88
     89  this->target = NULL;                             //< Nothing is Targeted by default.
    8890
    8991  this->projectile = CL_NULL;                      //< No Projectile Class is Connected to this weapon
  • trunk/src/world_entities/weapons/weapon.h

    r6736 r6756  
    125125    inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); };
    126126
     127    inline void setTarget(PNode* target) { this->target = target; };
     128
    127129    // STATE CHANGES //
    128130    /** @param state the State to time @param duration the duration of the State */
     
    207209    GLGuiBar*            energyWidget;
    208210
     211    PNode*               target;                           //!< A target for targeting Weapons.
     212
    209213    ////////////
    210214    // PHASES //
Note: See TracChangeset for help on using the changeset viewer.