Changeset 837


Ignore:
Timestamp:
Aug 18, 2011, 8:44:38 AM (8 years ago)
Author:
sam
Message:

emitter: fix wrong velocity value computation in the particles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emitter.cpp

    r792 r837  
    5555    for (int i = 0; i < data->nparticles; i++)
    5656    {
    57         data->velocities[i] = data->velocities[i] + deltams * data->gravity;
    58         data->positions[i] = data->positions[i] + deltams * data->velocities[i];
     57        vec3 oldvelocity = data->velocities[i];
     58        data->velocities[i] += deltams * data->gravity;
     59        data->positions[i] += deltams * 0.5f
     60                                      * (oldvelocity + data->velocities[i]);
    5961        if (data->positions[i].y < -100)
    6062        {
Note: See TracChangeset for help on using the changeset viewer.