Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
hrawanim.h
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.h $*
26 * *
27 * Original Author:: Greg Hjelstrom *
28 * *
29 * $Author:: Jani_p $*
30 * *
31 * $Modtime:: 6/27/01 7:50p $*
32 * *
33 * $Revision:: 2 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
38
39#if defined(_MSC_VER)
40#pragma once
41#endif
42
43#ifndef HRAWANIM_H
44#define HRAWANIM_H
45
46#include "always.h"
47#include "hanim.h"
48
50class BitChannelClass;
51
67
68/**********************************************************************************
69
70 HRawAnimClass
71
72 Stores motion data to be applied to a HierarchyTree. Each frame
73 of the motion contains deltas from the HierarchyTree's base position
74 to the desired position.
75
76**********************************************************************************/
77
79{
80
81public:
82
83 enum
84 {
87 };
88
89 HRawAnimClass(void);
90 ~HRawAnimClass(void);
91
92 int Load_W3D(ChunkLoadClass & cload);
93
94 const char * Get_Name(void) const { return Name; }
95 const char * Get_HName(void) const { return HierarchyName; }
96 int Get_Num_Frames(void) { return NumFrames; }
97 float Get_Frame_Rate() { return FrameRate; }
98 float Get_Total_Time() { return (float)NumFrames / FrameRate; }
99
100// Vector3 Get_Translation(int pividx,float frame);
101// Quaternion Get_Orientation(int pividx,float frame);
102 void Get_Translation(Vector3& translation, int pividx,float frame) const;
103 void Get_Orientation(Quaternion& orientation, int pividx,float frame) const;
104 void Get_Transform(Matrix3D& transform, int pividx,float frame) const;
105 bool Get_Visibility(int pividx,float frame);
106
107 bool Is_Node_Motion_Present(int pividx);
108 int Get_Num_Pivots(void) const { return NumNodes; }
109
110 // Methods that test the presence of a certain motion channel.
111 bool Has_X_Translation (int pividx);
112 bool Has_Y_Translation (int pividx);
113 bool Has_Z_Translation (int pividx);
114 bool Has_Rotation (int pividx);
115 bool Has_Visibility (int pividx);
116 NodeMotionStruct *Get_Node_Motion_Array(void) {return NodeMotion;}
117 virtual int Class_ID(void) const { return CLASSID_HRAWANIM; }
118
119private:
120
121 char Name[2*W3D_NAME_LEN];
122 char HierarchyName[W3D_NAME_LEN];
123
124 int NumFrames;
125 int NumNodes;
126 float FrameRate;
127
128 NodeMotionStruct * NodeMotion;
129
130 void Free(void);
131 bool read_channel(ChunkLoadClass & cload,MotionChannelClass * * newchan,bool pre30);
132 void add_channel(MotionChannelClass * newchan);
133
134 bool read_bit_channel(ChunkLoadClass & cload,BitChannelClass * * newchan,bool pre30);
135 void add_bit_channel(BitChannelClass * newchan);
136
137};
138
139
140
141
142#endif
143
#define W3D_NAME_LEN
Definition w3d_file.h:319
HAnimClass(void)
Definition hanim.h:85
@ CLASSID_HRAWANIM
Definition hanim.h:81
float Get_Total_Time()
Definition hrawanim.h:98
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
float Get_Frame_Rate()
Definition hrawanim.h:97
bool Has_Z_Translation(int pividx)
Definition hrawanim.cpp:717
int Get_Num_Pivots(void) const
Definition hrawanim.h:108
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
NodeMotionStruct * Get_Node_Motion_Array(void)
Definition hrawanim.h:116
int Get_Num_Frames(void)
Definition hrawanim.h:96
virtual int Class_ID(void) const
Definition hrawanim.h:117
const char * Get_Name(void) const
Definition hrawanim.h:94
~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
const char * Get_HName(void) const
Definition hrawanim.h:95
bool Get_Visibility(int pividx, float frame)
Definition hrawanim.cpp:666
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