Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
vxl.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/Tools/max2w3d/vxl.h 4 10/28/97 6:08p Greg_h $ */
20/***********************************************************************************************
21 *** Confidential - Westwood Studios ***
22 ***********************************************************************************************
23 * *
24 * Project Name : Commando Tools - W3D export *
25 * *
26 * $Archive:: /Commando/Code/Tools/max2w3d/vxl.h $*
27 * *
28 * $Author:: Greg_h $*
29 * *
30 * $Modtime:: 10/26/97 1:35p $*
31 * *
32 * $Revision:: 4 $*
33 * *
34 *---------------------------------------------------------------------------------------------*
35 * Functions: *
36 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
37
38
39#ifndef VXL_H
40#define VXL_H
41
42#ifndef ALWAYS_H
43#include "always.h"
44#endif
45
46#include <Max.h>
47
48#ifndef NODELIST_H
49#include "nodelist.h"
50#endif
51
52#ifndef VXLLAYER_H
53#include "vxllayer.h"
54#endif
55
56#ifndef PROGRESS_H
57#include "progress.h"
58#endif
59
60
61/*
62 This class is used to compute approximate physical properties of a polygon
63 mesh or meshes. Some of these properties are listed below:
64
65 - Moment of Inertia Tensor (with density factored out)
66 - Center of Mass
67 - Volume
68
69 It is a cannibalized version of the code from the voxel plugin.
70*/
71
73{
74public:
75
77 INodeListClass & meshlist,
78 int resolution,
79 Matrix3 parenttm,
80 TimeValue time,
82 );
83
84 ~VoxelClass(void);
85
86 int Get_Width() { return XDim; }
87 int Get_Height() { return YDim; }
88 int Num_Layers() { return ZDim; }
89 uint8 Is_Solid(int i,int j,int k);
90
91 void Compute_Physical_Properties(double Volume[1],double CM[3],double I[9]);
92
93private:
94
95 int XDim;
96 int YDim;
97 int ZDim;
98
99 double BlockXDim;
100 double BlockYDim;
101 double BlockZDim;
102
103 unsigned char * VisData;
104
105 float Resolution; // resolution of the voxel grid
106 TimeValue CurTime;
107 Point3 Offset;
108 Point3 Size;
109 Point3 Scale; // three scale values to fit the meshes into the desired grid
110
111 Point3 BoxCorner[8]; // World-Space corners of the bounding box of the voxel space
112 Matrix3 ParentTM; // coordinate system of the parent of this object.
113
114 void raw_set_vis(int i,int j,int k,uint8 val);
115 uint8 raw_read_vis(int i,int j,int k);
116
117 int voxel_touches_space(int i,int j,int k);
118 void purge_interior(void);
119
120 void Quantize_Meshes
121 (
122 INodeListClass & meshlist,
124 );
125
126 // set one layer of the voxel object
127 void Set_Layer
128 (
129 VoxelLayerClass & layer,
130 uint32 z
131 );
132
133 // compute the bounding box
134 void Compute_Bounding_Box(Point3 size,Point3 offset);
135
136 // 3D visibility
137 void Compute_Visiblity(Progress_Meter_Class & meter);
138
139 // returns the position of the center of voxel(i,j,k)
140 Point3 Voxel_Position(int i,int j,int k);
141};
142
143
144#endif /*VXL_H*/
unsigned long uint32
Definition bittype.h:46
unsigned char uint8
Definition bittype.h:44
void Compute_Physical_Properties(double Volume[1], double CM[3], double I[9])
Definition vxl.cpp:616
~VoxelClass(void)
Definition vxl.cpp:164
uint8 Is_Solid(int i, int j, int k)
Definition vxl.cpp:611
VoxelClass(INodeListClass &meshlist, int resolution, Matrix3 parenttm, TimeValue time, Progress_Meter_Class &meter)
Definition vxl.cpp:74
int Get_Height()
Definition vxl.h:87
int Get_Width()
Definition vxl.h:86
int Num_Layers()
Definition vxl.h:88
#define I(x, y, z)
Definition md5.cpp:89