libpsys

view src/pattr.h @ 9:9c24273f211b

first test is done
author John Tsiombikas <nuclear@mutantstargoat.com>
date Wed, 28 Sep 2011 03:42:01 +0300
parents d774738f50f6
children 23d4c50616ff
line source
1 #ifndef PATTR_H_
2 #define PATTR_H_
4 #include "pstrack.h"
5 #include "rndval.h"
7 /* the particle attributes vary from 0 to 1 during its lifetime */
8 struct psys_particle_attributes {
9 struct psys_track3 color;
10 struct psys_track alpha;
11 struct psys_track size;
12 };
14 struct psys_attributes {
15 unsigned int tex; /* OpenGL texture to use for the billboard */
17 struct psys_track3 spawn_range; /* radius of emmiter */
18 struct psys_track rate; /* spawn rate particles per sec */
19 struct psys_anm_rnd life; /* particle life in seconds */
20 struct psys_anm_rnd size; /* base particle size */
21 struct psys_anm_rnd3 dir; /* particle shoot direction */
23 struct psys_track3 grav; /* external force (usually gravity) */
24 float drag; /* I don't think this needs to animate */
26 /* particle attributes */
27 struct psys_particle_attributes part_attr;
29 /* limits */
30 int max_particles;
31 };
33 void psys_texture_loader(unsigned int (*load)(const char*, void*), void (*unload)(unsigned int, void*), void *cls);
35 int psys_init_attr(struct psys_attributes *attr);
36 void psys_destroy_attr(struct psys_attributes *attr);
38 void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm);
40 int psys_load_attr(struct psys_attributes *attr, const char *fname);
41 int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp);
43 int psys_save_attr(struct psys_attributes *attr, const char *fname);
44 int psys_save_attr_stream(struct psys_attributes *attr, FILE *fp);
46 #endif