Fix rotation
This commit is contained in:
@@ -87,7 +87,6 @@ bool updateParticle(const Texture2D tex, Particle *particle, f32 dt) {
|
||||
|
||||
Vector2 vel = Vector2Lerp(particle->startVel, particle->endVel, alpha);
|
||||
f32 size = Lerp(particle->startSize, particle->endSize, alpha);
|
||||
f32 rot = Lerp(particle->startRotSpeed, particle->endRotSpeed, alpha);
|
||||
Color startC = particle->startColor;
|
||||
Color endC = particle->endColor;
|
||||
Color color = lerpColor(startC, endC, alpha);
|
||||
@@ -104,9 +103,11 @@ bool updateParticle(const Texture2D tex, Particle *particle, f32 dt) {
|
||||
center.x,
|
||||
center.y,
|
||||
size, size
|
||||
}, (Vector2) {hSize, hSize}, rot, color);
|
||||
}, (Vector2) {hSize, hSize}, particle->rotation * DEG2RAD, color);
|
||||
EndBlendMode();
|
||||
|
||||
f32 rot = Lerp(particle->startRotSpeed, particle->endRotSpeed, alpha);
|
||||
particle->rotation += rot * dt;
|
||||
particle->pos = Vector2Add(particle->pos, Vector2Scale(vel, dt));
|
||||
particle->elapsed += dt;
|
||||
return alpha >= 1.0f;
|
||||
|
||||
Reference in New Issue
Block a user