Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2005, 10:46:36 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/particleEngine: no more random()

Location:
orxonox/branches/particleEngine/src/lib/graphics/particles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc

    r4001 r4016  
    133133          // emmits from EMITTER_DOT,
    134134          {
    135             Vector randDir = Vector(random()-RAND_MAX/2, random()-RAND_MAX/2, random()-RAND_MAX/2);
     135            Vector randDir = Vector(rand()-RAND_MAX/2, rand()-RAND_MAX/2, rand()-RAND_MAX/2);
    136136            randDir.normalize();
    137             randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)random()/RAND_MAX -.5), randDir)).apply(this->direction);
     137            randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)rand()/RAND_MAX -.5), randDir)).apply(this->direction);
    138138            Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity;
    139139           
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc

    r4001 r4016  
    277277        }
    278278     
    279       particles->timeToLive = this->lifeSpan + (float)(random()/RAND_MAX)* this->randomLifeSpan;
     279      particles->timeToLive = this->lifeSpan + (float)(rand()/RAND_MAX)* this->randomLifeSpan;
    280280      particles->position = position;
    281281      particles->velocity = velocity;
    282282
    283283      //  particle->rotation = ; //! \todo rotation is once again something to be done.
    284       particles->mass = this->initialMass + (random()/RAND_MAX -.5)* this->randomInitialMass;
    285       particles->radius = this->startRadius + (random()/RAND_MAX-.5)*this->randomStartRadius;
     284      particles->mass = this->initialMass + (rand()/RAND_MAX -.5)* this->randomInitialMass;
     285      particles->radius = this->startRadius + (rand()/RAND_MAX-.5)*this->randomStartRadius;
    286286     
    287       particles->radiusIt = (this->endRadius + (random()/RAND_MAX-.5)*this->randomEndRadius - particles->radius) / particles->timeToLive;
     287      particles->radiusIt = (this->endRadius + (rand()/RAND_MAX-.5)*this->randomEndRadius - particles->radius) / particles->timeToLive;
    288288
    289289      ++this->count;
Note: See TracChangeset for help on using the changeset viewer.