zenilib: zenilib/jni/external/lib3ds/src/lib3ds_track.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lib3ds_track.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1996-2008 by Jan Eric Kyprianidis <www.kyprianidis.com>
3 All rights reserved.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published
7 by the Free Software Foundation, either version 2.1 of the License, or
8 (at your option) any later version.
9
10 Thisprogram is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program; If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include "lib3ds_impl.h"
19
20
21 Lib3dsTrack*
22 lib3ds_track_new(Lib3dsTrackType type, int nkeys) {
23 Lib3dsTrack *track = (Lib3dsTrack*)calloc(sizeof(Lib3dsTrack), 1);
24 track->type = type;
25 lib3ds_track_resize(track, nkeys);
26 return track;
27 }
28
29
30 void
31 lib3ds_track_free(Lib3dsTrack *track) {
32 assert(track);
33 lib3ds_track_resize(track, 0);
34 memset(track, 0, sizeof(Lib3dsTrack));
35 free(track);
36 }
37
38
39 void
40 lib3ds_track_resize(Lib3dsTrack *track, int nkeys) {
41 char *p;
42
43 assert(track);
44 if (track->nkeys == nkeys)
45 return;
46
47 p = (char*)realloc(track->keys, sizeof(Lib3dsKey) * nkeys);
48 if (nkeys > track->nkeys) {
49 memset(p + (sizeof(Lib3dsKey)*track->nkeys), 0, sizeof(Lib3dsKey)*(nkeys - track->nkeys));
50 }
51 track->keys = (Lib3dsKey*)p;
52 track->nkeys = nkeys;
53 }
54
55
56 static void
57 pos_key_setup(int n, Lib3dsKey *pp, Lib3dsKey *pc, Lib3dsKey *pn, float *dd, float *ds) {
58 float tm, cm, cp, bm, bp, tmcm, tmcp, ksm, ksp, kdm, kdp, c;
59 float dt, fp, fn;
60 float delm[3], delp[3];
61 int i;
62
63 assert(pc);
64 fp = fn = 1.0f;
65 if (pp && pn) {
66 dt = 0.5f * (pn->frame - pp->frame);
67 fp = (float)(pc->frame - pp->frame) / dt;
68 fn = (float)(pn->frame - pc->frame) / dt;
69 c = (float)fabs(pc->cont);
70 fp = fp + c - c * fp;
71 fn = fn + c - c * fn;
72 }
73
74 cm = 1.0f - pc->cont;
75 tm = 0.5f * (1.0f - pc->tens);
76 cp = 2.0f - cm;
77 bm = 1.0f - pc->bias;
78 bp = 2.0f - bm;
79 tmcm = tm * cm;
80 tmcp = tm * cp;
81 ksm = tmcm * bp * fp;
82 ksp = tmcp * bm * fp;
83 kdm = tmcp * bp * fn;
84 kdp = tmcm * bm * fn;
85
86 for (i = 0; i < n; ++i) delm[i] = delp[i] = 0;
87 if (pp) {
88 for (i = 0; i < n; ++i) delm[i] = pc->value[i] - pp->value[i];
89 }
90 if (pn) {
91 for (i = 0; i < n; ++i) delp[i] = pn->value[i] - pc->value[i];
92 }
93 if (!pp) {
94 for (i = 0; i < n; ++i) delm[i] = delp[i];
95 }
96 if (!pn) {
97 for (i = 0; i < n; ++i) delp[i] = delm[i];
98 }
99
100 for (i = 0; i < n; ++i) {
101 ds[i] = ksm * delm[i] + ksp * delp[i];
102 dd[i] = kdm * delm[i] + kdp * delp[i];
103 }
104 }
105
106
107 static void
108 rot_key_setup(Lib3dsKey *prev, Lib3dsKey *cur, Lib3dsKey *next, float a[4], float b[4]) {
109 float tm, cm, cp, bm, bp, tmcm, tmcp, ksm, ksp, kdm, kdp, c;
110 float dt, fp, fn;
111 float q[4], qm[4], qp[4], qa[4], qb[4];
112 int i;
113
114 assert(cur);
115 if (prev) {
116 if (cur->value[3] > LIB3DS_TWOPI - LIB3DS_EPSILON) {
117 lib3ds_quat_axis_angle(qm, cur->value, 0.0f);
118 lib3ds_quat_ln(qm);
119 } else {
120 lib3ds_quat_copy(q, prev->value);
121 if (lib3ds_quat_dot(q, cur->value) < 0) lib3ds_quat_neg(q);
122 lib3ds_quat_ln_dif(qm, q, cur->value);
123 }
124 }
125 if (next) {
126 if (next->value[3] > LIB3DS_TWOPI - LIB3DS_EPSILON) {
127 lib3ds_quat_axis_angle(qp, next->value, 0.0f);
128 lib3ds_quat_ln(qp);
129 } else {
130 lib3ds_quat_copy(q, next->value);
131 if (lib3ds_quat_dot(q, cur->value) < 0) lib3ds_quat_neg(q);
132 lib3ds_quat_ln_dif(qp, cur->value, q);
133 }
134 }
135 if (!prev) lib3ds_quat_copy(qm, qp);
136 if (!next) lib3ds_quat_copy(qp, qm);
137
138 fp = fn = 1.0f;
139 cm = 1.0f - cur->cont;
140 if (prev && next) {
141 dt = 0.5f * (next->frame - prev->frame);
142 fp = (float)(cur->frame - prev->frame) / dt;
143 fn = (float)(next->frame - cur->frame) / dt;
144 c = (float)fabs(cur->cont);
145 fp = fp + c - c * fp;
146 fn = fn + c - c * fn;
147 }
148
149 tm = 0.5f * (1.0f - cur->tens);
150 cp = 2.0f - cm;
151 bm = 1.0f - cur->bias;
152 bp = 2.0f - bm;
153 tmcm = tm * cm;
154 tmcp = tm * cp;
155 ksm = 1.0f - tmcm * bp * fp;
156 ksp = -tmcp * bm * fp;
157 kdm = tmcp * bp * fn;
158 kdp = tmcm * bm * fn - 1.0f;
159
160 for (i = 0; i < 4; i++) {
161 qa[i] = 0.5f * (kdm * qm[i] + kdp * qp[i]);
162 qb[i] = 0.5f * (ksm * qm[i] + ksp * qp[i]);
163 }
164 lib3ds_quat_exp(qa);
165 lib3ds_quat_exp(qb);
166
167 lib3ds_quat_mul(a, cur->value, qa);
168 lib3ds_quat_mul(b, cur->value, qb);
169 }
170
171
172 static void
173 quat_for_index(Lib3dsTrack *track, int index, float q[4]) {
174 float p[4];
175 int i;
176 lib3ds_quat_identity(q);
177 for (i = 0; i <= index; ++i) {
178 lib3ds_quat_axis_angle(p, track->keys[i].value, track->keys[i].value[3]);
179 lib3ds_quat_mul(q, p, q);
180 }
181 }
182
183
184 static int
185 find_index(Lib3dsTrack *track, float t, float *u) {
186 int i;
187 float nt;
188 int t0, t1;
189
190 assert(track);
191 assert(track->nkeys > 0);
192
193 if (track->nkeys <= 1)
194 return -1;
195
196 t0 = track->keys[0].frame;
197 t1 = track->keys[track->nkeys-1].frame;
198 if (track->flags & LIB3DS_TRACK_REPEAT) {
199 nt = (float)fmod(t - t0, t1 - t0) + t0;
200 } else {
201 nt = t;
202 }
203
204 if (nt <= t0) {
205 return -1;
206 }
207 if (nt >= t1) {
208 return track->nkeys;
209 }
210
211 for (i = 1; i < track->nkeys; ++i) {
212 if (nt < track->keys[i].frame)
213 break;
214 }
215
216 *u = nt - (float)track->keys[i-1].frame;
217 *u /= (float)(track->keys[i].frame - track->keys[i-1].frame);
218
219 assert((*u >= 0.0f) && (*u <= 1.0f));
220 return i;
221 }
222
223
224 static void
225 setup_segment(Lib3dsTrack *track, int index, Lib3dsKey *pp, Lib3dsKey *p0, Lib3dsKey *p1, Lib3dsKey *pn) {
226 int ip, in;
227
228 pp->frame = pn->frame = -1;
229 if (index >= 2) {
230 ip = index - 2;
231 *pp = track->keys[index - 2];
232 } else {
233 if (track->flags & LIB3DS_TRACK_SMOOTH) {
234 ip = track->nkeys - 2;
235 *pp = track->keys[track->nkeys - 2];
236 pp->frame = track->keys[track->nkeys - 2].frame - (track->keys[track->nkeys - 1].frame - track->keys[0].frame);
237 }
238 }
239
240 *p0 = track->keys[index - 1];
241 *p1 = track->keys[index];
242
243 if (index < (int)track->nkeys - 1) {
244 in = index + 1;
245 *pn = track->keys[index + 1];
246 } else {
247 if (track->flags & LIB3DS_TRACK_SMOOTH) {
248 in = 1;
249 *pn = track->keys[1];
250 pn->frame = track->keys[1].frame + (track->keys[track->nkeys-1].frame - track->keys[0].frame);
251 }
252 }
253
254 if (track->type == LIB3DS_TRACK_QUAT) {
255 float q[4];
256 if (pp->frame >= 0) {
257 quat_for_index(track, ip, pp->value);
258 } else {
259 lib3ds_quat_identity(pp->value);
260 }
261
262 quat_for_index(track, index - 1, p0->value);
263 lib3ds_quat_axis_angle(q, track->keys[index].value, track->keys[index].value[3]);
264 lib3ds_quat_mul(p1->value, q, p0->value);
265
266 if (pn->frame >= 0) {
267 lib3ds_quat_axis_angle(q, track->keys[in].value, track->keys[in].value[3]);
268 lib3ds_quat_mul(pn->value, q, p1->value);
269 } else {
270 lib3ds_quat_identity(pn->value);
271 }
272 }
273 }
274
275
276 void
277 lib3ds_track_eval_bool(Lib3dsTrack *track, int *b, float t) {
278 *b = FALSE;
279 if (track) {
280 int index;
281 float u;
282
283 assert(track->type == LIB3DS_TRACK_BOOL);
284 if (!track->nkeys) {
285 return;
286 }
287
288 index = find_index(track, t, &u);
289 if (index < 0) {
290 *b = FALSE;
291 return;
292 }
293 if (index >= track->nkeys) {
294 *b = !(track->nkeys & 1);
295 return;
296 }
297 *b = !(index & 1);
298 }
299 }
300
301
302 static void
303 track_eval_linear(Lib3dsTrack *track, float *value, float t) {
304 Lib3dsKey pp, p0, p1, pn;
305 float u;
306 int index;
307 float dsp[3], ddp[3], dsn[3], ddn[3];
308
309 assert(track);
310 if (!track->nkeys) {
311 int i;
312 for (i = 0; i < track->type; ++i) value[i] = 0.0f;
313 return;
314 }
315
316 index = find_index(track, t, &u);
317
318 if (index < 0) {
319 int i;
320 for (i = 0; i < track->type; ++i) value[i] = track->keys[0].value[i];
321 return;
322 }
323 if (index >= track->nkeys) {
324 int i;
325 for (i = 0; i < track->type; ++i) value[i] = track->keys[track->nkeys-1].value[i];
326 return;
327 }
328
329 setup_segment(track, index, &pp, &p0, &p1, &pn);
330
331 pos_key_setup(track->type, pp.frame>=0? &pp : NULL, &p0, &p1, ddp, dsp);
332 pos_key_setup(track->type, &p0, &p1, pn.frame>=0? &pn : NULL, ddn, dsn);
333
334 lib3ds_math_cubic_interp(
335 value,
336 p0.value,
337 ddp,
338 dsn,
339 p1.value,
340 track->type,
341 u
342 );
343 }
344
345
346 void
347 lib3ds_track_eval_float(Lib3dsTrack *track, float *f, float t) {
348 *f = 0;
349 if (track) {
350 assert(track->type == LIB3DS_TRACK_FLOAT);
351 track_eval_linear(track, f, t);
352 }
353 }
354
355
356 void
357 lib3ds_track_eval_vector(Lib3dsTrack *track, float v[3], float t) {
358 lib3ds_vector_zero(v);
359 if (track) {
360 assert(track->type == LIB3DS_TRACK_VECTOR);
361 track_eval_linear(track, v, t);
362 }
363 }
364
365
366 void
367 lib3ds_track_eval_quat(Lib3dsTrack *track, float q[4], float t) {
368 lib3ds_quat_identity(q);
369 if (track) {
370 Lib3dsKey pp, p0, p1, pn;
371 float u;
372 int index;
373 float ap[4], bp[4], an[4], bn[4];
374
375 assert(track->type == LIB3DS_TRACK_QUAT);
376 if (!track->nkeys) {
377 return;
378 }
379
380 index = find_index(track, t, &u);
381 if (index < 0) {
382 lib3ds_quat_axis_angle(q, track->keys[0].value, track->keys[0].value[3]);
383 return;
384 }
385 if (index >= track->nkeys) {
386 quat_for_index(track, track->nkeys - 1, q);
387 return;
388 }
389
390 setup_segment(track, index, &pp, &p0, &p1, &pn);
391
392 rot_key_setup(pp.frame>=0? &pp : NULL, &p0, &p1, ap, bp);
393 rot_key_setup(&p0, &p1, pn.frame>=0? &pn : NULL, an, bn);
394
395 lib3ds_quat_squad(q, p0.value, ap, bn, p1.value, u);
396 }
397 }
398
399
400 static void
401 tcb_read(Lib3dsKey *key, Lib3dsIo *io) {
402 key->flags = lib3ds_io_read_word(io);
403 if (key->flags & LIB3DS_KEY_USE_TENS) {
404 key->tens = lib3ds_io_read_float(io);
405 }
406 if (key->flags & LIB3DS_KEY_USE_CONT) {
407 key->cont = lib3ds_io_read_float(io);
408 }
409 if (key->flags & LIB3DS_KEY_USE_BIAS) {
410 key->bias = lib3ds_io_read_float(io);
411 }
412 if (key->flags & LIB3DS_KEY_USE_EASE_TO) {
413 key->ease_to = lib3ds_io_read_float(io);
414 }
415 if (key->flags & LIB3DS_KEY_USE_EASE_FROM) {
416 key->ease_from = lib3ds_io_read_float(io);
417 }
418 }
419
420
421 void
422 lib3ds_track_read(Lib3dsTrack *track, Lib3dsIo *io) {
423 unsigned nkeys;
424 unsigned i;
425
426 track->flags = lib3ds_io_read_word(io);
427 lib3ds_io_read_dword(io);
428 lib3ds_io_read_dword(io);
429 nkeys = lib3ds_io_read_intd(io);
430 lib3ds_track_resize(track, nkeys);
431
432 switch (track->type) {
433 case LIB3DS_TRACK_BOOL:
434 for (i = 0; i < nkeys; ++i) {
435 track->keys[i].frame = lib3ds_io_read_intd(io);
436 tcb_read(&track->keys[i], io);
437 }
438 break;
439
440 case LIB3DS_TRACK_FLOAT:
441 for (i = 0; i < nkeys; ++i) {
442 track->keys[i].frame = lib3ds_io_read_intd(io);
443 tcb_read(&track->keys[i], io);
444 track->keys[i].value[0] = lib3ds_io_read_float(io);
445 }
446 break;
447
448 case LIB3DS_TRACK_VECTOR:
449 for (i = 0; i < nkeys; ++i) {
450 track->keys[i].frame = lib3ds_io_read_intd(io);
451 tcb_read(&track->keys[i], io);
452 lib3ds_io_read_vector(io, track->keys[i].value);
453 }
454 break;
455
456 case LIB3DS_TRACK_QUAT:
457 for (i = 0; i < nkeys; ++i) {
458 track->keys[i].frame = lib3ds_io_read_intd(io);
459 tcb_read(&track->keys[i], io);
460 track->keys[i].value[3] = lib3ds_io_read_float(io);
461 lib3ds_io_read_vector(io, track->keys[i].value);
462 }
463 break;
464
465 /*case LIB3DS_TRACK_MORPH:
466 for (i = 0; i < nkeys; ++i) {
467 track->keys[i].frame = lib3ds_io_read_intd(io);
468 tcb_read(&track->keys[i].tcb, io);
469 lib3ds_io_read_string(io, track->keys[i].data.m.name, 64);
470 }
471 break;*/
472
473 default:
474 break;
475 }
476 }
477
478
479 void
480 tcb_write(Lib3dsKey *key, Lib3dsIo *io) {
481 lib3ds_io_write_word(io, key->flags);
482 if (key->flags & LIB3DS_KEY_USE_TENS) {
483 lib3ds_io_write_float(io, key->tens);
484 }
485 if (key->flags & LIB3DS_KEY_USE_CONT) {
486 lib3ds_io_write_float(io, key->cont);
487 }
488 if (key->flags & LIB3DS_KEY_USE_BIAS) {
489 lib3ds_io_write_float(io, key->bias);
490 }
491 if (key->flags & LIB3DS_KEY_USE_EASE_TO) {
492 lib3ds_io_write_float(io, key->ease_to);
493 }
494 if (key->flags & LIB3DS_KEY_USE_EASE_FROM) {
495 lib3ds_io_write_float(io, key->ease_from);
496 }
497 }
498
499
500 void
501 lib3ds_track_write(Lib3dsTrack *track, Lib3dsIo *io) {
502 int i;
503
504 lib3ds_io_write_word(io, (uint16_t)track->flags);
505 lib3ds_io_write_dword(io, 0);
506 lib3ds_io_write_dword(io, 0);
507 lib3ds_io_write_dword(io, track->nkeys);
508
509 switch (track->type) {
510 case LIB3DS_TRACK_BOOL:
511 for (i = 0; i < track->nkeys; ++i) {
512 lib3ds_io_write_intd(io, track->keys[i].frame);
513 tcb_write(&track->keys[i], io);
514 }
515 break;
516
517 case LIB3DS_TRACK_FLOAT:
518 for (i = 0; i < track->nkeys; ++i) {
519 lib3ds_io_write_intd(io, track->keys[i].frame);
520 tcb_write(&track->keys[i], io);
521 lib3ds_io_write_float(io, track->keys[i].value[0]);
522 }
523 break;
524
525 case LIB3DS_TRACK_VECTOR:
526 for (i = 0; i < track->nkeys; ++i) {
527 lib3ds_io_write_intd(io, track->keys[i].frame);
528 tcb_write(&track->keys[i], io);
529 lib3ds_io_write_vector(io, track->keys[i].value);
530 }
531 break;
532
533 case LIB3DS_TRACK_QUAT:
534 for (i = 0; i < track->nkeys; ++i) {
535 lib3ds_io_write_intd(io, track->keys[i].frame);
536 tcb_write(&track->keys[i], io);
537 lib3ds_io_write_float(io, track->keys[i].value[3]);
538 lib3ds_io_write_vector(io, track->keys[i].value);
539 }
540 break;
541
542 /*case LIB3DS_TRACK_MORPH:
543 for (i = 0; i < track->nkeys; ++i) {
544 lib3ds_io_write_intd(io, track->keys[i].frame);
545 tcb_write(&track->keys[i].tcb, io);
546 lib3ds_io_write_string(io, track->keys[i].data.m.name);
547 }
548 break;*/
549 }
550 }
lib3ds_track_resize
LIB3DSAPI void lib3ds_track_resize(Lib3dsTrack *track, int nkeys)
Definition: lib3ds_track.c:40
lib3ds_math_cubic_interp
LIB3DSAPI void lib3ds_math_cubic_interp(float *v, float *a, float *p, float *q, float *b, int n, float t)
Definition: lib3ds_math.c:51
tcb_read
static void tcb_read(Lib3dsKey *key, Lib3dsIo *io)
Definition: lib3ds_track.c:401
t0
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition: glew.h:11582
lib3ds_io_write_intd
void lib3ds_io_write_intd(Lib3dsIo *io, int32_t d)
Definition: lib3ds_io.c:384
Lib3dsTrack::flags
unsigned flags
Definition: lib3ds.h:456
lib3ds_io_read_intd
int32_t lib3ds_io_read_intd(Lib3dsIo *io)
Definition: lib3ds_io.c:219
type
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: gl2ext.h:845
pos_key_setup
static void pos_key_setup(int n, Lib3dsKey *pp, Lib3dsKey *pc, Lib3dsKey *pn, float *dd, float *ds)
Definition: lib3ds_track.c:57
NULL
#define NULL
Definition: ftobjs.h:61
f
GLclampf f
Definition: glew.h:3390
Lib3dsTrack
Definition: lib3ds.h:455
lib3ds_quat_squad
LIB3DSAPI void lib3ds_quat_squad(float c[4], float a[4], float p[4], float q[4], float b[4], float t)
Definition: lib3ds_quat.c:264
uint16_t
unsigned short uint16_t
Definition: SDL_config_windows.h:60
lib3ds_quat_exp
LIB3DSAPI void lib3ds_quat_exp(float c[4])
Definition: lib3ds_quat.c:214
n
GLclampd n
Definition: glew.h:7287
LIB3DS_TRACK_BOOL
Definition: lib3ds.h:438
free
SDL_EventEntry * free
Definition: SDL_events.c:80
Lib3dsKey::ease_from
float ease_from
Definition: lib3ds.h:433
Lib3dsKey::value
float value[4]
Definition: lib3ds.h:434
lib3ds_io_read_vector
void lib3ds_io_read_vector(Lib3dsIo *io, float v[3])
Definition: lib3ds_io.c:258
t
GLdouble GLdouble t
Definition: glew.h:1384
in
GLuint in
Definition: glew.h:10672
pp
png_sPLT_entryp pp
Definition: pngrutil.c:1375
LIB3DS_KEY_USE_TENS
Definition: lib3ds.h:419
memset
#define memset
Definition: SDL_malloc.c:633
Lib3dsTrack::keys
Lib3dsKey * keys
Definition: lib3ds.h:459
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:8736
lib3ds_quat_neg
LIB3DSAPI void lib3ds_quat_neg(float c[4])
Definition: lib3ds_quat.c:74
assert
#define assert(x)
Definition: SDL_malloc.c:1234
lib3ds_quat_identity
LIB3DSAPI void lib3ds_quat_identity(float c[4])
Definition: lib3ds_quat.c:25
lib3ds_io_read_dword
uint32_t lib3ds_io_read_dword(Lib3dsIo *io)
Definition: lib3ds_io.c:172
find_index
static int find_index(Lib3dsTrack *track, float t, float *u)
Definition: lib3ds_track.c:185
calloc
#define calloc
Definition: SDL_malloc.c:636
lib3ds_quat_ln_dif
LIB3DSAPI void lib3ds_quat_ln_dif(float c[4], float a[4], float b[4])
Definition: lib3ds_quat.c:203
lib3ds_track_read
void lib3ds_track_read(Lib3dsTrack *track, Lib3dsIo *io)
Definition: lib3ds_track.c:422
track_eval_linear
static void track_eval_linear(Lib3dsTrack *track, float *value, float t)
Definition: lib3ds_track.c:303
t1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: glew.h:11582
lib3ds_io_write_vector
void lib3ds_io_write_vector(Lib3dsIo *io, float v[3])
Definition: lib3ds_io.c:422
lib3ds_io_write_float
void lib3ds_io_write_float(Lib3dsIo *io, float l)
Definition: lib3ds_io.c:402
u
ALuint u
Definition: alMain.h:58
lib3ds_track_eval_vector
LIB3DSAPI void lib3ds_track_eval_vector(Lib3dsTrack *track, float v[3], float t)
Definition: lib3ds_track.c:357
LIB3DS_TRACK_QUAT
Definition: lib3ds.h:441
Lib3dsKey::tens
float tens
Definition: lib3ds.h:429
v
const GLdouble * v
Definition: glew.h:1377
Lib3dsTrackType
Lib3dsTrackType
Definition: lib3ds.h:437
lib3ds_track_eval_bool
LIB3DSAPI void lib3ds_track_eval_bool(Lib3dsTrack *track, int *b, float t)
Definition: lib3ds_track.c:277
LIB3DS_TRACK_REPEAT
Definition: lib3ds.h:445
lib3ds_quat_ln
LIB3DSAPI void lib3ds_quat_ln(float c[4])
Definition: lib3ds_quat.c:182
Lib3dsTrack::type
Lib3dsTrackType type
Definition: lib3ds.h:457
LIB3DS_KEY_USE_CONT
Definition: lib3ds.h:420
p
GLfloat GLfloat p
Definition: glew.h:14938
lib3ds_vector_zero
LIB3DSAPI void lib3ds_vector_zero(float c[3])
Definition: lib3ds_vector.c:30
c
const GLfloat * c
Definition: glew.h:14913
setup_segment
static void setup_segment(Lib3dsTrack *track, int index, Lib3dsKey *pp, Lib3dsKey *p0, Lib3dsKey *p1, Lib3dsKey *pn)
Definition: lib3ds_track.c:225
realloc
#define realloc
Definition: SDL_malloc.c:637
LIB3DS_TWOPI
#define LIB3DS_TWOPI
Definition: lib3ds_impl.h:57
LIB3DS_KEY_USE_BIAS
Definition: lib3ds.h:421
lib3ds_track_eval_quat
LIB3DSAPI void lib3ds_track_eval_quat(Lib3dsTrack *track, float q[4], float t)
Definition: lib3ds_track.c:367
lib3ds_quat_dot
LIB3DSAPI float lib3ds_quat_dot(float a[4], float b[4])
Definition: lib3ds_quat.c:170
lib3ds_io_read_word
uint16_t lib3ds_io_read_word(Lib3dsIo *io)
Definition: lib3ds_io.c:156
index
GLuint index
Definition: glew.h:1800
LIB3DS_TRACK_VECTOR
Definition: lib3ds.h:440
lib3ds_io_read_float
float lib3ds_io_read_float(Lib3dsIo *io)
Definition: lib3ds_io.c:237
FALSE
#define FALSE
Definition: ftobjs.h:57
bp
static double bp[]
Definition: e_pow.c:72
LIB3DS_KEY_USE_EASE_TO
Definition: lib3ds.h:422
Lib3dsKey
Definition: lib3ds.h:426
LIB3DS_EPSILON
#define LIB3DS_EPSILON
Definition: lib3ds_impl.h:55
LIB3DS_TRACK_SMOOTH
Definition: lib3ds.h:446
Lib3dsKey::frame
int frame
Definition: lib3ds.h:427
value
EGLSurface EGLint void ** value
Definition: eglext.h:301
Lib3dsIo
Definition: lib3ds.h:56
Lib3dsTrack::nkeys
int nkeys
Definition: lib3ds.h:458
Lib3dsKey::cont
float cont
Definition: lib3ds.h:430
lib3ds_track_eval_float
LIB3DSAPI void lib3ds_track_eval_float(Lib3dsTrack *track, float *f, float t)
Definition: lib3ds_track.c:347
quat_for_index
static void quat_for_index(Lib3dsTrack *track, int index, float q[4])
Definition: lib3ds_track.c:173
q
GLdouble GLdouble GLdouble GLdouble q
Definition: glew.h:1400
lib3ds_quat_mul
LIB3DSAPI void lib3ds_quat_mul(float c[4], float a[4], float b[4])
Definition: lib3ds_quat.c:101
b
GLdouble GLdouble GLdouble b
Definition: glew.h:8383
LIB3DS_TRACK_FLOAT
Definition: lib3ds.h:439
lib3ds_track_free
LIB3DSAPI void lib3ds_track_free(Lib3dsTrack *track)
Definition: lib3ds_track.c:31
i
int i
Definition: pngrutil.c:1377
Lib3dsKey::bias
float bias
Definition: lib3ds.h:431
lib3ds_track_write
void lib3ds_track_write(Lib3dsTrack *track, Lib3dsIo *io)
Definition: lib3ds_track.c:501
lib3ds_io_write_dword
void lib3ds_io_write_dword(Lib3dsIo *io, uint32_t d)
Definition: lib3ds_io.c:338
rot_key_setup
static void rot_key_setup(Lib3dsKey *prev, Lib3dsKey *cur, Lib3dsKey *next, float a[4], float b[4])
Definition: lib3ds_track.c:108
lib3ds_quat_axis_angle
LIB3DSAPI void lib3ds_quat_axis_angle(float c[4], float axis[3], float angle)
Definition: lib3ds_quat.c:51
Lib3dsKey::ease_to
float ease_to
Definition: lib3ds.h:432
LIB3DS_KEY_USE_EASE_FROM
Definition: lib3ds.h:423
fabs
double fabs(double x)
Definition: s_fabs.c:29
tcb_write
void tcb_write(Lib3dsKey *key, Lib3dsIo *io)
Definition: lib3ds_track.c:480
lib3ds_impl.h
lib3ds_track_new
LIB3DSAPI Lib3dsTrack * lib3ds_track_new(Lib3dsTrackType type, int nkeys)
Definition: lib3ds_track.c:22
lib3ds_quat_copy
LIB3DSAPI void lib3ds_quat_copy(float dest[4], float src[4])
Definition: lib3ds_quat.c:35
cp
static double cp
Definition: e_pow.c:96
Lib3dsKey::flags
unsigned flags
Definition: lib3ds.h:428
lib3ds_io_write_word
void lib3ds_io_write_word(Lib3dsIo *io, uint16_t w)
Definition: lib3ds_io.c:322