Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
hrawanim.cpp
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program 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 General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/***********************************************************************************************
20 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21 ***********************************************************************************************
22 * *
23 * Project Name : WW3D *
24 * *
25 * $Archive:: /Commando/Code/ww3d2/hrawanim.cpp $*
26 * *
27 * Original Author:: Greg Hjelstrom *
28 * *
29 * $Author:: Jani_p $*
30 * *
31 * $Modtime:: 11/25/01 6:06p $*
32 * *
33 * $Revision:: 5 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * HRawAnimClass::HRawAnimClass -- constructor *
38 * HRawAnimClass::~HRawAnimClass -- Destructor *
39 * HRawAnimClass::Free -- De-allocates all memory in use *
40 * HRawAnimClass::Load -- Loads hierarchy animation from a file *
41 * HRawAnimClass::read_channel -- Reads in a single channel of motion *
42 * HRawAnimClass::add_channel -- Adds a motion channel to the animation *
43 * HRawAnimClass::Get_Translation -- returns the translation vector for the given frame *
44 * HRawAnimClass::Get_Orientation -- returns a quaternion for the orientation of the pivot *
45 * HRawAnimClass::Get_XRotation -- Returns the X euler angle for the given pivot, frame *
46 * HRawAnimClass::Get_YRotation -- returns the Y Euler angle for the given pivot, frame *
47 * HRawAnimClass::Get_ZRotation -- returns the Z Euler angle for the given pivot, frame *
48 * HRawAnimClass::read_bit_channel -- read a bit channel from the file *
49 * HRawAnimClass::add_bit_channel -- install a bit channel into the animation *
50 * HRawAnimClass::Get_Visibility -- return visibility state for given pivot/frame *
51 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
52
53#include "hrawanim.h"
54#include "motchan.h"
55#include "chunkio.h"
56#include "assetmgr.h"
57#include "htree.h"
58
59/***********************************************************************************************
60 * NodeMotionStruct::NodeMotionStruct -- constructor *
61 * *
62 * INPUT: *
63 * *
64 * OUTPUT: *
65 * *
66 * WARNINGS: *
67 * *
68 * HISTORY: *
69 *=============================================================================================*/
71 X(NULL),
72 Y(NULL),
73 Z(NULL),
74 XR(NULL),
75 YR(NULL),
76 ZR(NULL),
77 Q(NULL),
78 Vis(NULL)
79{
80}
81
82
83/***********************************************************************************************
84 * NodeMotionStruct::~NodeMotionStruct -- destructor *
85 * *
86 * INPUT: *
87 * *
88 * OUTPUT: *
89 * *
90 * WARNINGS: *
91 * *
92 * HISTORY: *
93 * 10/23/98 GTH : Created. *
94 *=============================================================================================*/
96{
97 if (X != NULL) {
98 delete X;
99 }
100 if (Y != NULL) {
101 delete Y;
102 }
103 if (Z != NULL) {
104 delete Z;
105 }
106 if (XR != NULL) {
107 delete XR;
108 }
109 if (YR != NULL) {
110 delete YR;
111 }
112 if (ZR != NULL) {
113 delete ZR;
114 }
115 if (Q != NULL) {
116 delete Q;
117 }
118 if (Vis != NULL) {
119 delete Vis;
120 }
121}
122
123
124/***********************************************************************************************
125 * HRawAnimClass::HRawAnimClass -- constructor *
126 * *
127 * INPUT: *
128 * *
129 * OUTPUT: *
130 * *
131 * WARNINGS: *
132 * *
133 * HISTORY: *
134 * 08/11/1997 GH : Created. *
135 *=============================================================================================*/
137 NumFrames(0),
138 NumNodes(0),
139 FrameRate(0),
140 NodeMotion(NULL)
141{
142 memset(Name,0,W3D_NAME_LEN);
143 memset(HierarchyName,0,W3D_NAME_LEN);
144}
145
146
147/***********************************************************************************************
148 * HRawAnimClass::~HRawAnimClass -- Destructor *
149 * *
150 * INPUT: *
151 * *
152 * OUTPUT: *
153 * *
154 * WARNINGS: *
155 * *
156 * HISTORY: *
157 * 08/11/1997 GH : Created. *
158 *=============================================================================================*/
160{
161 Free();
162}
163
164
165/***********************************************************************************************
166 * HRawAnimClass::Free -- De-allocates all memory in use *
167 * *
168 * INPUT: *
169 * *
170 * OUTPUT: *
171 * *
172 * WARNINGS: *
173 * *
174 * HISTORY: *
175 * 08/11/1997 GH : Created. *
176 *=============================================================================================*/
177void HRawAnimClass::Free(void)
178{
179 if (NodeMotion != NULL) {
180 delete[] NodeMotion;
181 NodeMotion = NULL;
182 }
183}
184
185
186/***********************************************************************************************
187 * HRawAnimClass::Load -- Loads hierarchy animation from a file *
188 * *
189 * INPUT: *
190 * *
191 * OUTPUT: *
192 * *
193 * WARNINGS: *
194 * *
195 * HISTORY: *
196 * 08/11/1997 GH : Created. *
197 *=============================================================================================*/
199{
200 bool pre30 = false;
201
202 /*
203 ** First make sure we release any memory in use
204 */
205 Free();
206
207 /*
208 ** Open the first chunk, it should be the animation header
209 */
210 if (!cload.Open_Chunk()) return LOAD_ERROR;
211
213 // ERROR: Expected Animation Header!
214 return LOAD_ERROR;
215 }
216
217 W3dAnimHeaderStruct aheader;
218 if (cload.Read(&aheader,sizeof(W3dAnimHeaderStruct)) != sizeof(W3dAnimHeaderStruct)) {
219 return LOAD_ERROR;
220 }
221
222 cload.Close_Chunk();
223
224 /*
225 ** Check if the animation version is pre-3.0. If so, we need to add 1 to all of the
226 ** bone indexes. In version 3.0 onward, all htree's use bone 0 as the root node.
227 */
228 if (aheader.Version < W3D_MAKE_VERSION(3,0)) {
229 pre30 = true;
230 }
231
232 strcpy(Name,aheader.HierarchyName);
233 strcat(Name,".");
234 strcat(Name,aheader.Name);
235
236 // TSS chasing crash bug 05/26/99
237 WWASSERT(HierarchyName != NULL);
238 WWASSERT(aheader.HierarchyName != NULL);
239 WWASSERT(sizeof(HierarchyName) >= W3D_NAME_LEN);
240 strncpy(HierarchyName,aheader.HierarchyName,W3D_NAME_LEN);
241
242 HTreeClass * base_pose = WW3DAssetManager::Get_Instance()->Get_HTree(HierarchyName);
243 if (base_pose == NULL) {
244 goto Error;
245 }
246 NumNodes = base_pose->Num_Pivots();
247
248 NumFrames = aheader.NumFrames;
249 FrameRate = aheader.FrameRate;
250
251 NodeMotion = W3DNEWARRAY NodeMotionStruct[ NumNodes ];
252 if (NodeMotion == NULL) {
253 goto Error;
254 }
255
256 /*
257 ** Now, read in all of the other chunks (motion channels).
258 */
259 MotionChannelClass * newchan;
260 BitChannelClass * newbitchan;
261
262 while (cload.Open_Chunk()) {
263
264 switch (cload.Cur_Chunk_ID()) {
265
267 if (!read_channel(cload,&newchan,pre30)) {
268 goto Error;
269 }
270
271 // (gth) if the channel is referring to a node which is outside the range,
272 // just throw away the channel. This probably means the animation must
273 // be re-exported
274 if (newchan->Get_Pivot() < NumNodes) {
275 add_channel(newchan);
276 } else {
277 WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.\n",Name));
278 delete newchan;
279 }
280 break;
281
283 if (!read_bit_channel(cload,&newbitchan,pre30)) {
284 goto Error;
285 }
286
287 // (gth) if the channel is referring to a node which is outside the range,
288 // just throw away the channel. This probably means the animation must
289 // be re-exported
290 if (newbitchan->Get_Pivot() < NumNodes) {
291 add_bit_channel(newbitchan);
292 } else {
293 WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.\n",Name));
294 delete newbitchan;
295 }
296 break;
297
298 default:
299 break;
300 }
301 cload.Close_Chunk();
302 }
303
304 return OK;
305
306Error:
307
308 Free();
309 return LOAD_ERROR;
310
311}
312
313/***********************************************************************************************
314 * HRawAnimClass::read_channel -- Reads in a single channel of motion *
315 * *
316 * INPUT: *
317 * *
318 * OUTPUT: *
319 * *
320 * WARNINGS: *
321 * *
322 * HISTORY: *
323 * 08/11/1997 GH : Created. *
324 *=============================================================================================*/
325bool HRawAnimClass::read_channel(ChunkLoadClass & cload,MotionChannelClass * * newchan,bool pre30)
326{
327 *newchan = W3DNEW MotionChannelClass;
328 bool result = (*newchan)->Load_W3D(cload);
329
330 if (result && pre30) {
331// (*newchan)->PivotIdx += 1;
332 (*newchan)->Set_Pivot((*newchan)->Get_Pivot()+1);
333 }
334
335 return result;
336}
337
338/***********************************************************************************************
339 * HRawAnimClass::add_channel -- Adds a motion channel to the animation *
340 * *
341 * INPUT: *
342 * *
343 * OUTPUT: *
344 * *
345 * WARNINGS: *
346 * *
347 * HISTORY: *
348 * 08/11/1997 GH : Created. *
349 *=============================================================================================*/
350void HRawAnimClass::add_channel(MotionChannelClass * newchan)
351{
352 int idx = newchan->Get_Pivot();
353
354 switch (newchan->Get_Type())
355 {
356 case ANIM_CHANNEL_X:
357 NodeMotion[idx].X = newchan;
358 break;
359
360 case ANIM_CHANNEL_Y:
361 NodeMotion[idx].Y = newchan;
362 break;
363
364 case ANIM_CHANNEL_Z:
365 NodeMotion[idx].Z = newchan;
366 break;
367
368 case ANIM_CHANNEL_XR:
369 NodeMotion[idx].XR = newchan;
370 break;
371
372 case ANIM_CHANNEL_YR:
373 NodeMotion[idx].YR = newchan;
374 break;
375
376 case ANIM_CHANNEL_ZR:
377 NodeMotion[idx].ZR = newchan;
378 break;
379
380 case ANIM_CHANNEL_Q:
381 NodeMotion[idx].Q = newchan;
382 break;
383 }
384
385}
386
387
388/***********************************************************************************************
389 * HRawAnimClass::read_bit_channel -- read a bit channel from the file *
390 * *
391 * INPUT: *
392 * *
393 * OUTPUT: *
394 * *
395 * WARNINGS: *
396 * *
397 * HISTORY: *
398 * 1/19/98 GTH : Created. *
399 *=============================================================================================*/
400bool HRawAnimClass::read_bit_channel(ChunkLoadClass & cload,BitChannelClass * * newchan,bool pre30)
401{
402 *newchan = W3DNEW BitChannelClass;
403 bool result = (*newchan)->Load_W3D(cload);
404
405 if (result && pre30) {
406 (*newchan)->PivotIdx += 1;
407 }
408
409 return result;
410}
411
412
413/***********************************************************************************************
414 * HRawAnimClass::add_bit_channel -- install a bit channel into the animation *
415 * *
416 * INPUT: *
417 * *
418 * OUTPUT: *
419 * *
420 * WARNINGS: *
421 * *
422 * HISTORY: *
423 * 1/19/98 GTH : Created. *
424 *=============================================================================================*/
425void HRawAnimClass::add_bit_channel(BitChannelClass * newchan)
426{
427 int idx = newchan->Get_Pivot();
428
429 switch (newchan->Get_Type())
430 {
431 case BIT_CHANNEL_VIS:
432 NodeMotion[idx].Vis = newchan;
433 break;
434 }
435}
436
437/***********************************************************************************************
438 * HRawAnimClass::Get_Translation -- returns the translation vector for the given fr *
439 * *
440 * INPUT: *
441 * *
442 * OUTPUT: *
443 * *
444 * WARNINGS: *
445 * *
446 * HISTORY: *
447 * 08/11/1997 GH : Created. *
448 *=============================================================================================*/
449void HRawAnimClass::Get_Translation(Vector3& trans, int pividx, float frame ) const
450{
451 struct NodeMotionStruct * motion = &NodeMotion[pividx];
452
453 if ( (motion->X == NULL) && (motion->Y == NULL) && (motion->Z == NULL) ) {
454 trans.Set(0.0f,0.0f,0.0f);
455 return;
456 }
457
458// int frame0 = (int)frame;
459 int frame0=WWMath::Float_To_Long(frame-0.499999f);
460
461 int frame1 = frame0 + 1;
462
463 float ratio = frame - (float)frame0;
464 WWASSERT( (ratio >= -WWMATH_EPSILON) && (ratio < 1.0f + WWMATH_EPSILON) );
465
466 if ( frame1 >= NumFrames ) {
467 frame1 = 0;
468 }
469
470 Vector3 trans0(0.0f,0.0f,0.0f);
471
472 if (motion->X != NULL) {
473 motion->X->Get_Vector((int)frame0,&(trans0[0]));
474 }
475 if (motion->Y != NULL) {
476 motion->Y->Get_Vector((int)frame0,&(trans0[1]));
477 }
478 if (motion->Z != NULL) {
479 motion->Z->Get_Vector((int)frame0,&(trans0[2]));
480 }
481
482 if ( ratio == 0.0f ) {
483 trans=trans0;
484 return;
485 }
486
487 Vector3 trans1(0.0f,0.0f,0.0f);
488
489 if (motion->X != NULL) {
490 motion->X->Get_Vector((int)frame1,&(trans1[0]));
491 }
492 if (motion->Y != NULL) {
493 motion->Y->Get_Vector((int)frame1,&(trans1[1]));
494 }
495 if (motion->Z != NULL) {
496 motion->Z->Get_Vector((int)frame1,&(trans1[2]));
497 }
498
499 Vector3::Lerp( trans0, trans1, ratio, &trans );
500}
501
502/***********************************************************************************************
503 * HRawAnimClass::Get_Orientation -- returns a quaternion for the orientation of the *
504 * *
505 * INPUT: *
506 * *
507 * OUTPUT: *
508 * *
509 * WARNINGS: *
510 * *
511 * HISTORY: *
512 * 08/11/1997 GH : Created. *
513 *=============================================================================================*/
514void HRawAnimClass::Get_Orientation(Quaternion& q, int pividx,float frame) const
515{
516// int frame0 = (int)frame;
517 int frame0 = WWMath::Float_To_Long(frame-0.499999f);
518 int frame1 = frame0 + 1;
519
520 float ratio = frame - (float)frame0;
521 WWASSERT( (ratio >= -WWMATH_EPSILON) && (ratio < 1.0f + WWMATH_EPSILON) );
522
523 if ( frame1 >= NumFrames )
524 {
525 frame1 = 0;
526 }
527
528#ifdef SPECIAL_GETVEC_AS_QUAT
529
530 Quaternion q0, q1;
531
532 MotionChannelClass* mc = NodeMotion[pividx].Q;
533 if (mc != NULL)
534 {
535 mc->Get_Vector_As_Quat((int)frame0, q0);
536 mc->Get_Vector_As_Quat((int)frame1, q1);
537 }
538 else
539 {
540 q0.Set();
541 q1.Set();
542 }
543
544 if ( ratio == 0.0f )
545 {
546 q = q0;
547 }
548 else if ( ratio == 1.0f )
549 {
550 q = q1;
551 }
552 else
553 {
554 Fast_Slerp(q, q0, q1, ratio);
555 }
556
557#else
558 float vals[4];
559
560 Quaternion q0(1);
561 if (NodeMotion[pividx].Q != NULL) {
562 NodeMotion[pividx].Q->Get_Vector((int)frame0,vals);
563 q0.Set(vals[0],vals[1],vals[2],vals[3]);
564 }
565
566 if ( ratio == 0.0f ) {
567 q=q0;
568 return;
569 }
570
571 Quaternion q1(1);
572 if (NodeMotion[pividx].Q != NULL) {
573 NodeMotion[pividx].Q->Get_Vector((int)frame1,vals);
574 q1.Set(vals[0],vals[1],vals[2],vals[3]);
575 }
576
577 Fast_Slerp(q, q0, q1, ratio );
578#endif
579}
580
581/***********************************************************************************************
582 * HRawAnimClass::Get_Transform -- returns the transform matrix for the given frame *
583 * *
584 * INPUT: *
585 * *
586 * OUTPUT: *
587 * *
588 * WARNINGS: *
589 * *
590 * HISTORY: *
591 * 08/11/1997 GH : Created. *
592 *=============================================================================================*/
593void HRawAnimClass::Get_Transform(Matrix3D& mtx, int pividx, float frame ) const
594{
595 struct NodeMotionStruct * motion = &NodeMotion[pividx];
596
597// if ( (motion->X == NULL) && (motion->Y == NULL) && (motion->Z == NULL) ) {
598// trans.Set(0.0f,0.0f,0.0f);
599// return;
600// }
601
602 int frame0=WWMath::Float_To_Long(frame-0.499999f);
603
604 int frame1 = frame0 + 1;
605
606 float ratio = frame - (float)frame0;
607 WWASSERT( (ratio >= -WWMATH_EPSILON) && (ratio < 1.0f + WWMATH_EPSILON) );
608
609 if ( frame1 >= NumFrames ) {
610 frame1 = 0;
611 }
612
613 float vals[4];
614 Quaternion q0(1);
615 if (NodeMotion[pividx].Q != NULL) {
616 NodeMotion[pividx].Q->Get_Vector((int)frame0,vals);
617 q0.Set(vals[0],vals[1],vals[2],vals[3]);
618 }
619
620 if ( ratio == 0.0f ) {
621 ::Build_Matrix3D(q0,mtx);
622 if (motion->X != NULL) motion->X->Get_Vector((int)frame0,&(mtx[0][3]));
623 if (motion->Y != NULL) motion->Y->Get_Vector((int)frame0,&(mtx[1][3]));
624 if (motion->Z != NULL) motion->Z->Get_Vector((int)frame0,&(mtx[2][3]));
625 return;
626 }
627
628 Quaternion q1(1);
629 if (NodeMotion[pividx].Q != NULL) {
630 NodeMotion[pividx].Q->Get_Vector((int)frame1,vals);
631 q1.Set(vals[0],vals[1],vals[2],vals[3]);
632 }
633
635 Fast_Slerp(q, q0, q1, ratio );
636 ::Build_Matrix3D(q,mtx);
637
638 Vector3 trans0(0.0f,0.0f,0.0f);
639 if (motion->X != NULL) motion->X->Get_Vector((int)frame0,&(trans0[0]));
640 if (motion->Y != NULL) motion->Y->Get_Vector((int)frame0,&(trans0[1]));
641 if (motion->Z != NULL) motion->Z->Get_Vector((int)frame0,&(trans0[2]));
642
643 Vector3 trans1(0.0f,0.0f,0.0f);
644 if (motion->X != NULL) motion->X->Get_Vector((int)frame1,&(trans1[0]));
645 if (motion->Y != NULL) motion->Y->Get_Vector((int)frame1,&(trans1[1]));
646 if (motion->Z != NULL) motion->Z->Get_Vector((int)frame1,&(trans1[2]));
647
648 Vector3 trans;
649 Vector3::Lerp( trans0, trans1, ratio, &trans );
650
651 mtx.Set_Translation(trans);
652}
653
654/***********************************************************************************************
655 * HRawAnimClass::Get_Visibility -- return visibility state for given pivot/frame *
656 * *
657 * INPUT: *
658 * *
659 * OUTPUT: *
660 * *
661 * WARNINGS: *
662 * *
663 * HISTORY: *
664 * 1/19/98 GTH : Created. *
665 *=============================================================================================*/
666bool HRawAnimClass::Get_Visibility(int pividx,float frame)
667{
668 if (NodeMotion[pividx].Vis != NULL) {
669 return (NodeMotion[pividx].Vis->Get_Bit((int)frame) == 1);
670 }
671
672 // default to always visible...
673 return 1;
674}
675
676
677/***********************************************************************************************
678 * HRawAnimClass::Is_Node_Motion_Present -- return true if there is motion defined for this frame *
679 * *
680 * INPUT: *
681 * *
682 * OUTPUT: *
683 * *
684 * WARNINGS: *
685 * *
686 * HISTORY: *
687 * 3/23/99 EHC : Created. *
688 *=============================================================================================*/
690{
691 WWASSERT((pividx >= 0) && (pividx < NumNodes));
692
693 if (NodeMotion[pividx].X != NULL) return true;
694 if (NodeMotion[pividx].Y != NULL) return true;
695 if (NodeMotion[pividx].Z != NULL) return true;
696 if (NodeMotion[pividx].XR != NULL) return true;
697 if (NodeMotion[pividx].YR != NULL) return true;
698 if (NodeMotion[pividx].ZR != NULL) return true;
699 if (NodeMotion[pividx].Q != NULL) return true;
700 if (NodeMotion[pividx].Vis != NULL) return true;
701
702 return false;
703}
704
706{
707 WWASSERT((pividx >= 0) && (pividx < NumNodes));
708 return NodeMotion[pividx].X != NULL;
709}
710
712{
713 WWASSERT((pividx >= 0) && (pividx < NumNodes));
714 return NodeMotion[pividx].Y != NULL;
715}
716
718{
719 WWASSERT((pividx >= 0) && (pividx < NumNodes));
720 return NodeMotion[pividx].Z != NULL;
721}
722
724{
725 WWASSERT((pividx >= 0) && (pividx < NumNodes));
726 return NodeMotion[pividx].Q != NULL;
727}
728
730{
731 WWASSERT((pividx >= 0) && (pividx < NumNodes));
732 return NodeMotion[pividx].Vis != NULL;
733}
734
735
#define NULL
Definition BaseType.h:92
#define WWASSERT
#define W3D_NAME_LEN
Definition w3d_file.h:319
@ W3D_CHUNK_BIT_CHANNEL
Definition w3d_file.h:404
@ W3D_CHUNK_ANIMATION_HEADER
Definition w3d_file.h:402
@ W3D_CHUNK_ANIMATION_CHANNEL
Definition w3d_file.h:403
@ ANIM_CHANNEL_YR
Definition w3d_file.h:1417
@ ANIM_CHANNEL_Y
Definition w3d_file.h:1414
@ ANIM_CHANNEL_XR
Definition w3d_file.h:1416
@ ANIM_CHANNEL_Z
Definition w3d_file.h:1415
@ ANIM_CHANNEL_X
Definition w3d_file.h:1413
@ ANIM_CHANNEL_ZR
Definition w3d_file.h:1418
@ ANIM_CHANNEL_Q
Definition w3d_file.h:1419
#define W3D_MAKE_VERSION(major, minor)
Definition w3d_file.h:315
@ BIT_CHANNEL_VIS
Definition w3d_file.h:1458
#define W3DNEWARRAY
Definition always.h:110
#define W3DNEW
Definition always.h:109
#define WWMATH_EPSILON
Definition wwmath.h:54
bool Load_W3D(ChunkLoadClass &cload)
Definition motchan.cpp:273
WWINLINE int Get_Type(void) const
Definition motchan.h:171
WWINLINE int Get_Pivot(void) const
Definition motchan.h:172
bool Close_Chunk()
Definition chunkio.cpp:448
uint32 Cur_Chunk_ID()
Definition chunkio.cpp:484
uint32 Read(void *buf, uint32 nbytes)
Definition chunkio.cpp:692
bool Open_Chunk()
Definition chunkio.cpp:412
bool Has_Y_Translation(int pividx)
Definition hrawanim.cpp:711
HRawAnimClass(void)
Definition hrawanim.cpp:136
bool Is_Node_Motion_Present(int pividx)
Definition hrawanim.cpp:689
bool Has_X_Translation(int pividx)
Definition hrawanim.cpp:705
bool Has_Z_Translation(int pividx)
Definition hrawanim.cpp:717
void Get_Transform(Matrix3D &transform, int pividx, float frame) const
Definition hrawanim.cpp:593
void Get_Orientation(Quaternion &orientation, int pividx, float frame) const
Definition hrawanim.cpp:514
bool Has_Rotation(int pividx)
Definition hrawanim.cpp:723
int Load_W3D(ChunkLoadClass &cload)
Definition hrawanim.cpp:198
~HRawAnimClass(void)
Definition hrawanim.cpp:159
void Get_Translation(Vector3 &translation, int pividx, float frame) const
Definition hrawanim.cpp:449
bool Has_Visibility(int pividx)
Definition hrawanim.cpp:729
bool Get_Visibility(int pividx, float frame)
Definition hrawanim.cpp:666
WWINLINE int Num_Pivots(void) const
Definition htree.h:93
WWINLINE void Set_Translation(const Vector3 &t)
Definition matrix3d.h:219
WWINLINE int Get_Type(void) const
Definition motchan.h:76
bool Load_W3D(ChunkLoadClass &cload)
Definition motchan.cpp:161
WWINLINE void Get_Vector_As_Quat(int frame, Quaternion &quat) const
Definition motchan.h:138
WWINLINE int Get_Pivot(void) const
Definition motchan.h:77
void Get_Vector(int frame, float *setvec) const
Definition motchan.h:121
WWINLINE void Set(float a=0.0, float b=0.0, float c=0.0, float d=1.0)
Definition quat.h:73
WWINLINE void Set(float x, float y, float z)
Definition vector3.h:103
static void Lerp(const Vector3 &a, const Vector3 &b, float alpha, Vector3 *set_result)
Definition vector3.h:535
static WW3DAssetManager * Get_Instance(void)
Definition assetmgr.h:205
virtual HTreeClass * Get_HTree(const char *name)
static long Float_To_Long(float f)
Definition wwmath.h:322
int q
Definition test1.cpp:94
void __cdecl Fast_Slerp(Quaternion &res, const Quaternion &p, const Quaternion &q, float alpha)
Definition quat.cpp:441
Matrix3D & Build_Matrix3D(const Quaternion &q, Matrix3D &out)
Definition quat.h:208
MotionChannelClass * X
Definition hrawanim.h:57
MotionChannelClass * ZR
Definition hrawanim.h:62
MotionChannelClass * YR
Definition hrawanim.h:61
MotionChannelClass * Y
Definition hrawanim.h:58
MotionChannelClass * Q
Definition hrawanim.h:63
BitChannelClass * Vis
Definition hrawanim.h:65
MotionChannelClass * Z
Definition hrawanim.h:59
MotionChannelClass * XR
Definition hrawanim.h:60
char HierarchyName[W3D_NAME_LEN]
Definition w3d_file.h:1394
char Name[W3D_NAME_LEN]
Definition w3d_file.h:1393
#define WWDEBUG_SAY(x)
Definition wwdebug.h:114