Fix rotation

This commit is contained in:
2024-02-10 14:33:07 +01:00
parent b39202f730
commit 6eddf11cfa
3 changed files with 7 additions and 7 deletions

View File

@@ -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;