25 static int _add_key(
Keylist *,
int,
float);
26 static void _remove_key(
Keylist *);
31 static float Keystartpos = 0.0;
32 static float Keyendpos = 1.0;
33 static float Tension = 0.8;
34 static int Viewsteps = 0;
35 static int Numkeys = 0;
40 static int _add_key(
Keylist *newk,
int force_replace,
float precis)
49 for (k = Keys; k; k = k->
next) {
50 if (k->
pos >= newk->
pos - precis && k->
pos <= newk->
pos + precis) {
76 if (newk->
pos < Keys->
pos) {
97 Keytail = prev->
next = newk;
103 Keys = Keytail = newk;
110 static void _remove_key(
Keylist *k)
157 Tension = tens > 1.0 ? 1.0 : (tens < 0.0 ? 0.0 : tens);
215 if (
NULL == (fp = fopen(
name,
"w"))) {
219 fprintf(fp,
"30 \n");
221 for (k = Keys; k; k = k->
next) {
224 "{%f {{FromX %f} {FromY %f} {FromZ %f} {DirX %f} {DirY %f} "
225 "{DirZ %f} {FOV %f} {TWIST %f} {cplane-0 {{pos_x 0.000000} "
226 "{pos_y 0.000000} {pos_z 0.000000} {blend_type OFF} {rot "
227 "0.000000} {tilt 0.000000}}}} keyanimtag%d 0} ",
262 Keystartpos = Keys->
pos;
265 if (Interpmode ==
KF_LINEAR && Numkeys > 1) {
274 G_warning(
_(
"Check no. of frames requested and keyframes marked"));
277 else if (Numkeys > 2) {
287 G_warning(
_(
"Check no. of frames requested and keyframes marked"));
301 Viewsteps = newsteps;
342 for (k = Keys; k; k = k->
next) {
343 if (k->
pos >= oldpos - precis && k->
pos <= oldpos + precis) {
346 _add_key(k, 1, precis);
374 for (cnt = 0, k = Keys; k;) {
377 if (k->
pos >= pos - precis && k->
pos <= pos + precis) {
431 int GK_add_key(
float pos,
unsigned long fmask,
int force_replace,
float precis)
437 fprintf(stderr,
"Out of memory\n");
448 G_debug(3,
"KEY FROM: %f %f %f", tmp[
X], tmp[
Y], tmp[
Z]);
470 if (0 < _add_key(newk, force_replace, precis)) {
490 if (step > 0 && step <= Viewsteps) {
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int GS_get_twist(void)
Get twist value.
int gk_draw_path(Viewnode *, int, Keylist *)
Draw path.
Viewnode * gk_make_linear_framesfromkeys(Keylist *, int, int, int)
Generate viewnode from keyframe list (linear interpolation)
void GS_draw_all_list(void)
Draw all glLists.
void GS_get_viewdir(float *)
Get viewdir.
void GS_set_draw(int)
Sets which buffer to draw to.
void GS_get_from(float *)
Get viewpoint 'from' position.
void GS_alldraw_wire(void)
Draw all wires.
int GS_get_fov(void)
Get field of view.
void GV_alldraw_vect(void)
Draw all loaded vector sets.
void GVL_alldraw_vol(void)
Draw all volume sets.
void gk_free_key(Keylist *)
Free keyframe list.
Viewnode * gk_make_framesfromkeys(Keylist *, int, int, int, float)
Generate viewnode from keyframes.
unsigned int GS_background_color(void)
Get background color.
void GS_clear(int)
Clear view.
void GS_done_draw(void)
Draw done, swap buffers.
void gk_follow_frames(Viewnode *, int, Keylist *, int, int, int, unsigned long)
Checks key masks.
void GP_alldraw_site(void)
Draw all available point sets.
void GK_set_tension(float tens)
Set value for tension when interpmode is KF_SPLINE.
int GK_set_interpmode(int mode)
Set interpolation mode.
void GK_show_vol(int flag)
Show volumes.
void GK_do_framestep(int step, int render)
Moves the animation to frame number "step".
void GK_show_vect(int flag)
Show vector sets.
void GK_update_tension(void)
Update tension.
void GK_showtension_stop(void)
Show tension stop ?
void GK_showtension_start(void)
void GK_show_path(int flag)
Draw the current path.
void GK_show_list(int flag)
Show list.
void GK_print_keys(const char *name)
Print keyframe info.
void GK_show_site(int flag)
Show point sets.
int GK_delete_key(float pos, float precis, int justone)
void GK_set_numsteps(int newsteps)
Set the number of frames to be interpolated from keyframes.
void GK_update_frames(void)
Recalculate path using the current number of frames requested.
int GK_move_key(float oldpos, float precis, float newpos)
Move keyframe.
int GK_add_key(float pos, unsigned long fmask, int force_replace, float precis)
Add keyframe.
void GK_clear_keys(void)
Deletes all keyframes, resets field masks.
float fields[KF_NUMFIELDS]