Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4434 in orxonox.OLD for orxonox/trunk/src/lib/particles


Ignore:
Timestamp:
Jun 1, 2005, 11:27:12 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: PerParticle-animations work as expected

Location:
orxonox/trunk/src/lib/particles
Files:
2 edited

Legend:

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

    r4433 r4434  
    240240      // rendering new position.
    241241      tickPart->position = tickPart->position + tickPart->velocity * dt;
    242       tickPart->radius = radiusAnim.getValue(tickPart->lifeCycle);
     242      tickPart->radius = radiusAnim.getValue(tickPart->lifeCycle)
     243        + randRadiusAnim.getValue(tickPart->lifeCycle) * tickPart->radiusRand;
     244
     245      tickPart->mass = massAnim.getValue(tickPart->lifeCycle)
     246        + randMassAnim.getValue(tickPart->lifeCycle) * tickPart->massRand;
    243247     
    244248      tickPart->extForce = Vector(0,0,0);
     
    450454
    451455      //  particle->rotation = ; //! \todo rotation is once again something to be done.
    452       particles->mass = this->massAnim.getValue(0.0);
    453       particles->radius = this->radiusAnim.getValue(0.0);
     456      particles->massRand = 2*(float)rand()/RAND_MAX -1;
     457      particles->radiusRand = 2* (float)rand()/RAND_MAX -1;
     458      particles->mass = this->massAnim.getValue(0.0) + this->randMassAnim.getValue(0.0)*particles->massRand;
     459      particles->radius = this->radiusAnim.getValue(0.0) + this->randRadiusAnim.getValue(0.0)*particles->radiusRand;
    454460
    455461      ++this->count;
  • orxonox/trunk/src/lib/particles/particle_system.h

    r4433 r4434  
    4949  Quaternion rotation;        //!< The current rotation of this particle.
    5050  float mass;                 //!< The mass of this particle.
     51  float massRand;
    5152  float radius;               //!< The current size of this particle.
    52   float radiusIt;             //!< The difference of the Size per second.
     53  float radiusRand;
    5354
    5455  GLfloat color [4];          //!< A Color for the particles.
Note: See TracChangeset for help on using the changeset viewer.