Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2005, 10:19:38 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: mass and radius are animateable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/particles/particle_system.cc

    r4421 r4430  
    5353  this->setInheritSpeed(0);
    5454  this->glID = NULL;
    55   this->setRadius(1.0, 1.0, 0.0);
    5655  this->setType(type, 1);
    57   this->setColor(1.0,1.0,1.0,1.0, .5,.5,.5,.5, .0,.0,.0,.0);
    58   this->setMass(1.0, 0.0);
     56  //  this->setColor(1.0,1.0,1.0,1.0, .5,.5,.5,.5, .0,.0,.0,.0);
    5957  ParticleEngine::getInstance()->addSystem(this);
    60 
    61   radiusAnim.addEntry(0.0,5);
    62 
    63   radiusAnim.addEntry(.80,3);
    64 
    65   radiusAnim.addEntry(.5, 0);
    6658}
    6759
     
    148140}
    149141
    150 
    151 
    152142/**
    153143   \brief how much of the speed from the ParticleEmitter should flow onto the ParticleSystem
     
    178168
    179169/**
    180    \brief sets the radius of newly created particles
    181 */
    182 void ParticleSystem::setRadius(float startRadius, float endRadius, float randomStartRadius, float randomEndRadius)
    183 {
    184   this->startRadius = startRadius;
    185   this->endRadius = endRadius;
    186   this->randomStartRadius = randomStartRadius;
    187   this->randomEndRadius = randomEndRadius;
    188 }
    189 
    190 /**
    191    \brief sets the initial mass of any particle
    192 */
    193 void ParticleSystem::setMass(float mass, float randomMass)
    194 {
    195   this->initialMass = mass;
    196   this->randomInitialMass = randomMass;
    197 }
    198 
    199 /**
    200170   \brief sets the conserve Factor of newly created particles
    201171*/
     
    210180}
    211181
     182/////////////////////////////
     183/* Per-Particle Attributes */
     184/////////////////////////////
     185/**
     186   \brief sets a key in the radius-animation on a per-particle basis
     187   \param lifeCycleTime the time (partilceLifeTime/particleAge) [0-1]
     188   \param radius the radius at this position
     189   \param randRadius the randRadius at this position
     190*/
     191void ParticleSystem::setRadius(float lifeCycleTime, float radius, float randRadius)
     192{
     193  this->radiusAnim.addEntry(lifeCycleTime, radius);
     194  this->randRadiusAnim.addEntry(lifeCycleTime, randRadius);
     195}
     196
     197/**
     198   \brief sets a key in the mass-animation on a per-particle basis
     199   \param lifeCycleTime the time (partilceLifeTime/particleAge) [0-1]
     200   \param mass the mass at this position
     201   \param randMass the randomMass at this position
     202*/
     203void ParticleSystem::setMass(float lifeCycleTime, float mass, float randMass)
     204{
     205  this->massAnim.addEntry(lifeCycleTime, mass);
     206  this->randMassAnim.addEntry(lifeCycleTime, randMass);
     207}
    212208
    213209/**
Note: See TracChangeset for help on using the changeset viewer.