vrshoot

annotate libs/psys/pattr.h @ 2:334d17aed7de

visual studio project files
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 18:36:38 +0200
parents
children
rev   line source
nuclear@0 1 #ifndef PATTR_H_
nuclear@0 2 #define PATTR_H_
nuclear@0 3
nuclear@0 4 #include "pstrack.h"
nuclear@0 5 #include "rndval.h"
nuclear@0 6
nuclear@0 7 /* the particle attributes vary from 0 to 1 during its lifetime */
nuclear@0 8 struct psys_particle_attributes {
nuclear@0 9 struct psys_track3 color;
nuclear@0 10 struct psys_track alpha;
nuclear@0 11 struct psys_track size;
nuclear@0 12 };
nuclear@0 13
nuclear@0 14 struct psys_attributes {
nuclear@0 15 unsigned int tex; /* OpenGL texture to use for the billboard */
nuclear@0 16
nuclear@0 17 struct psys_track3 spawn_range; /* radius of emmiter */
nuclear@0 18 struct psys_track rate; /* spawn rate particles per sec */
nuclear@0 19 struct psys_anm_rnd life; /* particle life in seconds */
nuclear@0 20 struct psys_anm_rnd size; /* base particle size */
nuclear@0 21 struct psys_anm_rnd3 dir; /* particle shoot direction */
nuclear@0 22
nuclear@0 23 struct psys_track3 grav; /* external force (usually gravity) */
nuclear@0 24 float drag; /* I don't think this needs to animate */
nuclear@0 25
nuclear@0 26 /* particle attributes */
nuclear@0 27 struct psys_particle_attributes part_attr;
nuclear@0 28
nuclear@0 29 /* limits */
nuclear@0 30 int max_particles;
nuclear@0 31 };
nuclear@0 32
nuclear@0 33 #ifdef __cplusplus
nuclear@0 34 extern "C" {
nuclear@0 35 #endif
nuclear@0 36
nuclear@0 37 void psys_texture_loader(unsigned int (*load)(const char*, void*), void (*unload)(unsigned int, void*), void *cls);
nuclear@0 38
nuclear@0 39 struct psys_attributes *psys_create_attr(void);
nuclear@0 40 void psys_free_attr(struct psys_attributes *attr);
nuclear@0 41
nuclear@0 42 int psys_init_attr(struct psys_attributes *attr);
nuclear@0 43 void psys_destroy_attr(struct psys_attributes *attr);
nuclear@0 44
nuclear@0 45 /* copies particle system attributes src to dest
nuclear@0 46 * XXX: dest must have been initialized first
nuclear@0 47 */
nuclear@0 48 void psys_copy_attr(struct psys_attributes *dest, const struct psys_attributes *src);
nuclear@0 49
nuclear@0 50 void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm);
nuclear@0 51
nuclear@0 52 int psys_load_attr(struct psys_attributes *attr, const char *fname);
nuclear@0 53 int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp);
nuclear@0 54
nuclear@0 55 int psys_save_attr(const struct psys_attributes *attr, const char *fname);
nuclear@0 56 int psys_save_attr_stream(const struct psys_attributes *attr, FILE *fp);
nuclear@0 57
nuclear@0 58 #ifdef __cplusplus
nuclear@0 59 }
nuclear@0 60 #endif
nuclear@0 61
nuclear@0 62 #endif /* PATTR_H_ */