Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
pivot.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/pivot.h 1 1/22/01 3:36p Greg_h $ */
20/***********************************************************************************************
21 *** Confidential - Westwood Studios ***
22 ***********************************************************************************************
23 * *
24 * Project Name : Commando / G 3D Library *
25 * *
26 * $Archive:: /Commando/Code/ww3d2/pivot.h $*
27 * *
28 * Author:: Greg_h *
29 * *
30 * $Modtime:: 1/08/01 10:04a $*
31 * *
32 * $Revision:: 1 $*
33 * *
34 *---------------------------------------------------------------------------------------------*
35 * Functions: *
36 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
37
38#if defined(_MSC_VER)
39#pragma once
40#endif
41
42#ifndef PIVOT_H
43#define PIVOT_H
44
45#include "always.h"
46#include "vector3.h"
47#include "matrix3d.h"
48#include "quat.h"
49#include "w3d_file.h"
50
51
52/*
53
54 PivotClass
55
56 Each node of the hierarchy tree is represented by a
57 PivotClass.
58
59*/
60
61//#define LAZY_CAP_MTX_ALLOC
62
64{
65public:
66
67 PivotClass(void);
68 PivotClass(const PivotClass& that);
69 PivotClass& operator=(const PivotClass& that);
70
72 {
73#ifdef LAZY_CAP_MTX_ALLOC
74 if (CapTransformPtr)
75 delete CapTransformPtr;
76#endif
77 }
78
79 void Capture_Update(void);
80 bool Is_Captured() const
81 {
82#ifdef LAZY_CAP_MTX_ALLOC
83 return CapTransformPtr != NULL;
84#else
85 return IsCaptured;
86#endif
87 }
88
89public:
92 Matrix3D BaseTransform; // base-pose transform (relative to parent).
93 Matrix3D Transform; // computed transform for this pivot
94 // User control. When a pivot is 'captured' animation data is ignored and the
95 // user data is used to control the pivot.
96#ifdef LAZY_CAP_MTX_ALLOC
97 DynamicMatrix3D* CapTransformPtr;
98 short Index;
99 bool IsVisible; // result of the visibility channel
101#else
103 int Index;
104 bool IsVisible; // result of the visibility channel
107 bool Unused; // padding
108#endif
109
110};
111
112
113
114#endif
#define NULL
Definition BaseType.h:92
#define W3D_NAME_LEN
Definition w3d_file.h:319
bool Is_Captured() const
Definition pivot.h:80
Matrix3D CapTransform
Definition pivot.h:102
Matrix3D BaseTransform
Definition pivot.h:92
PivotClass * Parent
Definition pivot.h:91
Matrix3D Transform
Definition pivot.h:93
~PivotClass(void)
Definition pivot.h:71
PivotClass(void)
Definition pivot.cpp:58
bool IsCaptured
Definition pivot.h:106
PivotClass & operator=(const PivotClass &that)
Definition pivot.cpp:107
bool Unused
Definition pivot.h:107
char Name[W3D_NAME_LEN]
Definition pivot.h:90
bool IsVisible
Definition pivot.h:104
bool WorldSpaceTranslation
Definition pivot.h:105
void Capture_Update(void)
Definition pivot.cpp:137
int Index
Definition pivot.h:103