vrshoot

diff libs/psys/pstrack.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/psys/pstrack.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,49 @@
     1.4 +#ifndef PSTRACK_H_
     1.5 +#define PSTRACK_H_
     1.6 +
     1.7 +#include <vmath/vmath.h>
     1.8 +#include <anim/anim.h>
     1.9 +
    1.10 +struct psys_track {
    1.11 +	struct anm_track trk;
    1.12 +
    1.13 +	anm_time_t cache_tm;
    1.14 +	float cache_val;
    1.15 +};
    1.16 +
    1.17 +struct psys_track3 {
    1.18 +	struct anm_track x, y, z;
    1.19 +
    1.20 +	anm_time_t cache_tm;
    1.21 +	vec3_t cache_vec;
    1.22 +};
    1.23 +
    1.24 +#ifdef __cplusplus
    1.25 +extern "C" {
    1.26 +#endif
    1.27 +
    1.28 +int psys_init_track(struct psys_track *track);
    1.29 +void psys_destroy_track(struct psys_track *track);
    1.30 +
    1.31 +int psys_init_track3(struct psys_track3 *track);
    1.32 +void psys_destroy_track3(struct psys_track3 *track);
    1.33 +
    1.34 +/* XXX dest must have been initialized first */
    1.35 +void psys_copy_track(struct psys_track *dest, const struct psys_track *src);
    1.36 +void psys_copy_track3(struct psys_track3 *dest, const struct psys_track3 *src);
    1.37 +
    1.38 +void psys_eval_track(struct psys_track *track, anm_time_t tm);
    1.39 +void psys_set_value(struct psys_track *track, anm_time_t tm, float v);
    1.40 +float psys_get_value(struct psys_track *track, anm_time_t tm);
    1.41 +float psys_get_cur_value(struct psys_track *track);
    1.42 +
    1.43 +void psys_eval_track3(struct psys_track3 *track, anm_time_t tm);
    1.44 +void psys_set_value3(struct psys_track3 *track, anm_time_t tm, vec3_t v);
    1.45 +vec3_t psys_get_value3(struct psys_track3 *track, anm_time_t tm);
    1.46 +vec3_t psys_get_cur_value3(struct psys_track3 *track);
    1.47 +
    1.48 +#ifdef __cplusplus
    1.49 +}
    1.50 +#endif
    1.51 +
    1.52 +#endif	/* PSTRACK_H_ */