mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Particles now have fixed origin. (ParticleSystem::SetPosition will only affect
new particles, and existing particles will not gravitate against the new point). This is another requirement to implement ParticleSystem in GLSL.
This commit is contained in:
@@ -95,6 +95,8 @@ namespace opengl
|
||||
max = direction + spread/2.0f;
|
||||
pLast->direction = (rand() / (float(RAND_MAX)+1)) * (max - min) + min;
|
||||
|
||||
pLast->origin = position;
|
||||
|
||||
min = speedMin;
|
||||
max = speedMax;
|
||||
float speed = (rand() / (float(RAND_MAX)+1)) * (max - min) + min;
|
||||
@@ -447,7 +449,7 @@ namespace opengl
|
||||
love::Vector ppos(p->position[0], p->position[1]);
|
||||
|
||||
// Get vector from particle center to particle.
|
||||
radial = ppos - position;
|
||||
radial = ppos - p->origin;
|
||||
radial.normalize();
|
||||
tangential = radial;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user