-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparticle.h
More file actions
31 lines (25 loc) · 971 Bytes
/
Copy pathparticle.h
File metadata and controls
31 lines (25 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef PARTICLE_H_INCLUDED
#define PARTICLE_H_INCLUDED
struct grid_s;
typedef struct
{
float position_x;
float position_y;
float velocity_x;
float velocity_y;
}particle_t;
typedef struct
{
particle_t* particles;
unsigned int num_particles;
unsigned int max_particles;
}particle_system_t;
particle_system_t* particle_system_new(int max_particles);
void particle_system_add_particle(particle_system_t* system,float x,float y);
void particle_system_delete_particle(particle_system_t* system,int particle);
float bilinear_kernel(float x,float y);
void particle_system_mark_grid_cells(particle_system_t* particle_system,struct grid_s* grid);
void particle_system_transfer_to_grid(particle_system_t* particle_system,struct grid_s* grid);
void particle_system_advect(particle_system_t* particle_system,struct grid_s* grid,float delta_t);
void particle_system_remove_invalid_particles(particle_system_t* particle_system,struct grid_s* grid);
#endif // PARTICLE_H_INCLUDED