Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
hcanim.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/* $Header: /Commando/Code/ww3d2/hcanim.h 2 6/29/01 6:41p Jani_p $ */
20/***********************************************************************************************
21 *** Confidential - Westwood Studios ***
22 ***********************************************************************************************
23 * *
24 * Project Name : Commando / G 3D Library *
25 * *
26 * $Archive:: /Commando/Code/ww3d2/hcanim.h $*
27 * *
28 * Author:: Greg_h *
29 * *
30 * $Modtime:: 6/27/01 7:35p $*
31 * *
32 * $Revision:: 2 $*
33 * *
34 *---------------------------------------------------------------------------------------------*
35 * Functions: *
36 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
37
38
39#if defined(_MSC_VER)
40#pragma once
41#endif
42
43#ifndef HCANIM_H
44#define HCANIM_H
45
46#include "always.h"
47#include "quat.h"
48#include "refcount.h"
49#include "w3d_file.h"
50#include "slist.h"
51#include "vector.h"
52#include "hanim.h"
53
58class HTreeClass;
59class ChunkLoadClass;
60class ChunkSaveClass;
61
62
63/**********************************************************************************
64
65 Hierarchy Compressed Animation Class
66
67 Stores motion data to be applied to a HierarchyTree. Each frame
68 of the motion contains deltas from the HierarchyTree's base position
69 to the desired position.
70
71**********************************************************************************/
72
74{
75
76public:
77
78 enum
79 {
82 };
83
86
87 int Load_W3D(ChunkLoadClass & cload);
88
89 const char * Get_Name(void) const { return Name; }
90 const char * Get_HName(void) const { return HierarchyName; }
91 int Get_Num_Frames(void) { return NumFrames; }
92 float Get_Frame_Rate() { return FrameRate; }
93 float Get_Total_Time() { return (float)NumFrames / FrameRate; }
94 int Get_Flavor() { return Flavor; }
95
96// Vector3 Get_Translation(int pividx,float frame);
97// Quaternion Get_Orientation(int pividx,float frame);
98 void Get_Translation(Vector3& translation, int pividx,float frame) const;
99 void Get_Orientation(Quaternion& orientation, int pividx,float frame) const;
100 void Get_Transform(Matrix3D& transform, int pividx,float frame) const;
101 bool Get_Visibility(int pividx,float frame);
102
103 bool Is_Node_Motion_Present(int pividx);
104 int Get_Num_Pivots(void) const { return NumNodes; }
105
106 // Methods that test the presence of a certain motion channel.
107 bool Has_X_Translation (int pividx);
108 bool Has_Y_Translation (int pividx);
109 bool Has_Z_Translation (int pividx);
110 bool Has_Rotation (int pividx);
111 bool Has_Visibility (int pividx);
112
113private:
114
115 char Name[2*W3D_NAME_LEN];
116 char HierarchyName[W3D_NAME_LEN];
117
118 int NumFrames;
119 int NumNodes;
120 int Flavor;
121 float FrameRate;
122
123 NodeCompressedMotionStruct * NodeMotion;
124
125 void Free(void);
126 bool read_channel(ChunkLoadClass & cload,TimeCodedMotionChannelClass * * newchan);
127 bool read_channel(ChunkLoadClass & cload,AdaptiveDeltaMotionChannelClass * * newchan);
128 void add_channel(TimeCodedMotionChannelClass * newchan);
129 void add_channel(AdaptiveDeltaMotionChannelClass * newchan);
130
131
132 bool read_bit_channel(ChunkLoadClass & cload,TimeCodedBitChannelClass * * newchan);
133 void add_bit_channel(TimeCodedBitChannelClass * newchan);
134
135};
136
137
138#endif // hcanim.h
139
#define W3D_NAME_LEN
Definition w3d_file.h:319
HAnimClass(void)
Definition hanim.h:85
bool Has_X_Translation(int pividx)
Definition hcanim.cpp:679
int Get_Num_Pivots(void) const
Definition hcanim.h:104
bool Has_Y_Translation(int pividx)
Definition hcanim.cpp:685
int Get_Num_Frames(void)
Definition hcanim.h:91
bool Has_Visibility(int pividx)
Definition hcanim.cpp:703
bool Get_Visibility(int pividx, float frame)
Definition hcanim.cpp:640
const char * Get_HName(void) const
Definition hcanim.h:90
void Get_Transform(Matrix3D &transform, int pividx, float frame) const
Definition hcanim.cpp:594
bool Has_Z_Translation(int pividx)
Definition hcanim.cpp:691
void Get_Translation(Vector3 &translation, int pividx, float frame) const
Definition hcanim.cpp:530
bool Is_Node_Motion_Present(int pividx)
Definition hcanim.cpp:666
const char * Get_Name(void) const
Definition hcanim.h:89
bool Has_Rotation(int pividx)
Definition hcanim.cpp:697
float Get_Frame_Rate()
Definition hcanim.h:92
~HCompressedAnimClass(void)
Definition hcanim.cpp:197
void Get_Orientation(Quaternion &orientation, int pividx, float frame) const
Definition hcanim.cpp:565
float Get_Total_Time()
Definition hcanim.h:93
int Load_W3D(ChunkLoadClass &cload)
Definition hcanim.cpp:235