WID comments
[Lilanci.git] / particle.h
blobfe5d3aab1e7e4d9c2174ae759f6cfde98f416c39
1 #pragma once
2 #include "gr.h"
4 typedef void (*TempFunc)(double temp, SDL_Color *c);
5 //x(t+dt) = x(t)+dt*v(t)
6 //vx(t+dt) = vx(t)*(1-fx*dt) +dt*a(t)
7 //when t <=0.0 particle dies
8 typedef struct{
9 double x;
10 double y;
11 double t;
12 int z;
13 double vx;
14 double vy;
15 double vt;
16 double ax;
17 double ay;
18 double at;
19 double fx;
20 double fy;
21 double ft;
22 Sprite *s;
23 TempFunc tf;
24 }Particle;
26 void SetParticleBoundingBox(double x, double y, double xx, double yy); // x,y - coords; xx,yy -- width, height; THIS FUNCTION SHOULD BE CALLED BEFORE USING PARTICLES
27 void AddParticle(Particle *p); //doesn't copy p, p will be freed automagically when it is not needed anymore
28 void UpdateAndQueueDrawParticles(double dt);