Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
dynamesh.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 : Commando *
24 * *
25 * $Archive:: /Commando/Code/ww3d2/dynamesh.h $*
26 * *
27 * $Author:: Greg_h $*
28 * *
29 * $Modtime:: 12/03/01 4:20p $*
30 * *
31 * $Revision:: 15 $*
32 * *
33 *-------------------------------------------------------------------------*/
34
35
36#if defined(_MSC_VER)
37#pragma once
38#endif
39
40#ifndef DYNAMESH_H
41#define DYNAMESH_H
42
43#include "meshgeometry.h"
44#include "meshmatdesc.h"
45#include "matinfo.h"
46#include "rendobj.h"
47#include "polyinfo.h"
48#include "dx8wrapper.h"
49
50class ShaderClass;
53
54/*
55** DynamicMeshModel: used for low-level rendering of DynamicMeshClass.
56** It is composed of the same two classes (one base, one embedded as
57** MeshModelClass, so many of its features are similar (see meshmdl.h)
58*/
60{
62
63public:
64
65 DynamicMeshModel(unsigned int max_polys, unsigned int max_verts);
66 DynamicMeshModel(unsigned int max_polys, unsigned int max_verts, MaterialInfoClass *mat_info);
69
70 // Inherited from MeshGeometryClass
71 virtual void Compute_Plane_Equations(void);
72 virtual void Compute_Vertex_Normals(void);
73 virtual void Compute_Bounds(Vector3 * verts);
74
75 // Reset mesh (with existing max polygon and max vertex counts)
76 void Reset(void);
77
78 // Render mesh
79 void Render(RenderInfoClass & rinfo);
80
81 // Set current polygon and vertex counts
82 void Set_Counts(int pnum, int vnum) { DynamicMeshPNum = pnum; DynamicMeshVNum = vnum; }
83
84 // Access to material stuff:
85 unsigned * Get_Color_Array(int color_array_index) { return MatDesc->Get_Color_Array(color_array_index); }
86 Vector2 * Get_UV_Array(int uv_array_index) { return MatDesc->Get_UV_Array_By_Index(uv_array_index); }
87
88 void Set_Single_Material(VertexMaterialClass * vmat, int pass=0) { MatDesc->Set_Single_Material(vmat, pass); }
89 void Set_Single_Texture(TextureClass * tex, int pass=0, int stage=0) { MatDesc->Set_Single_Texture(tex, pass, stage); }
90 void Set_Single_Shader(ShaderClass shader, int pass=0) { MatDesc->Set_Single_Shader(shader, pass); }
91
92 void Set_Material(int vidx, VertexMaterialClass * vmat, int pass=0) { MatDesc->Set_Material(vidx, vmat, pass); }
93 void Set_Shader(int pidx, ShaderClass shader, int pass=0) { MatDesc->Set_Shader(pidx, shader, pass); }
94 void Set_Texture(int pidx, TextureClass * tex, int pass=0, int stage=0) { MatDesc->Set_Texture(pidx, tex, pass, stage); }
95 void Set_Pass_Count(int passes) { MatDesc->Set_Pass_Count(passes); }
96 int Get_Pass_Count(void) const { return MatDesc->Get_Pass_Count(); }
97
98 // Create the array (if it doesn't exist), fill it with the supplied value.
99 void Initialize_Texture_Array(int pass, int stage, TextureClass *texture = NULL);
100 void Initialize_Material_Array(int pass, VertexMaterialClass *vmat = NULL);
101
102 // Accessors to material info:
103 MaterialInfoClass *Peek_Material_Info(void) { return MatInfo; }
104 MaterialInfoClass *Get_Material_Info(void) { if (MatInfo) MatInfo->Add_Ref(); return MatInfo;}
106 {
107 if (MatInfo)
108 MatInfo->Release_Ref();
109 WWASSERT(MatInfo != 0);
110 MatInfo = mat_info;
111 MatInfo->Add_Ref();
112 }
113
114 // New geometry accessors (non-const)
117
118private:
119
120 // These are current counts, as opposed to those in the mesh geometry and
121 // material description which are actually maximum counts.
122 int DynamicMeshPNum;
123 int DynamicMeshVNum;
124
125 // All non-geometry properties (uvs, colors, textures, shaders, etc)
126 MeshMatDescClass * MatDesc;
127
128 // Lists of textures and vertex materials for ease of processing
129 MaterialInfoClass * MatInfo;
130
131};
132
133/*
134** Dynamic Meshes
135*/
137
138public:
139
140 // constructor and destructor
141 DynamicMeshClass( int max_poly, int max_vert);
142 DynamicMeshClass( int max_poly, int max_vert, MaterialInfoClass *mat_info);
144 virtual ~DynamicMeshClass( void);
145
146 // Inherited from RenderObjClass:
147 virtual RenderObjClass * Clone(void) const;
148 virtual int Class_ID(void) const { return CLASSID_DYNAMESH; }
149 virtual void Render(RenderInfoClass & rinfo);
150
151 virtual MaterialInfoClass *Peek_Material_Info(void) { return Model->Peek_Material_Info(); }
152 virtual MaterialInfoClass *Get_Material_Info(void) { return Model->Get_Material_Info(); }
153 virtual void Set_Material_Info(MaterialInfoClass *mat_info) { Model->Set_Material_Info(mat_info); }
154
155 // all render objects should be able to tell you how many polygons were
156 // used in the making of the render object.
157 virtual int Get_Num_Polys(void) const { return PolyCount; }
158
159 // return the number of vertices used by this renderobject
160 virtual int Get_Num_Vertices(void) const { return VertCount; }
161
162 // Get and set static sort level
163 virtual int Get_Sort_Level(void) const { return SortLevel; }
164 virtual void Set_Sort_Level(int level) { SortLevel = level; if(level != SORT_LEVEL_NONE) Disable_Sort();}
165
166 // object space bounding volumes
167 virtual inline void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
168 virtual inline void Get_Obj_Space_Bounding_Box(AABoxClass & box) const;
169
170 // Set the vertex material for the current triangle
171 int Set_Vertex_Material( int idx, int pass = 0);
172 int Set_Vertex_Material( VertexMaterialClass *material, bool dont_search = false, int pass = 0);
173
174 // Set the number of passes for the mesh
175 void Set_Pass_Count(int passes) { assert(PolyCount == 0); Model->Set_Pass_Count(passes); }
176 int Get_Pass_Count() { return Model->Get_Pass_Count(); }
177
178 // Set the texture for the current triangle
179 int Set_Texture( int idx, int pass = 0);
180 int Set_Texture( TextureClass *texture, bool dont_search = false, int pass = 0);
181
182 // Set the shader for the current triangle
183 int Set_Shader( const ShaderClass & shader, int pass = 0) { Model->Set_Single_Shader(shader, pass); return 0; }
184
185 // set the shader, texture, and vertex material as found in the polygon info object
186 void Set_Polygon_Info(const PolygonInfoClass &polyInfo, bool dont_search_texture = false, bool dont_search_vertex_material = false, int pass = 0)
187 {
188 // there must be a shader..
189 assert(polyInfo.Peek_Shader() != 0);
190 Set_Shader(* (polyInfo.Peek_Shader()), pass);
191
192 assert(polyInfo.Peek_Vertex_Material() != 0);
193 Set_Vertex_Material(polyInfo.Peek_Vertex_Material(), dont_search_vertex_material, pass);
194
195 if (polyInfo.Peek_Texture())
196 Set_Texture(polyInfo.Peek_Texture(), dont_search_texture, pass);
197 }
198
199 // Set vertex Color
200 inline int Set_Vertex_Color(const Vector4 & color, int color_array_index = 0);
201 inline int Set_Vertex_Color(const Vector3 & color, int color_array_index = 0);
202
203 // reset the mesh flags
204 void Reset_Flags() { Set_Dirty(); }
205
206 // Flush the mesh
207 void Reset_Native_Mesh() { Model->Reset(); }
208
209 // reset our poly and vertex counts
211 {
212 Model->Set_Counts(0, 0);
213 Disable_Sort();
214 PolyCount = 0;
215 VertCount = 0;
216 }
217
218 // Reset all polys and verts. Call the other reset functions directly if you do not want all
219 // characteristics to be reset.
220 virtual void Reset( void )
221 {
222 // Note that the active poly count has changed since the last render call by setting the dirty flag
223 Reset_Flags();
226
227 // reset all the texture & vertex material indices
228 int pass = MAX_PASSES;
229 while (pass--) {
230 TextureIdx[pass] = -1;
231 VertexMaterialIdx[pass] = -1;
232 MultiVertexMaterial[pass] = false;
233 }
234 }
235
236 // Deletes mesh and recreates it with new max_polys and verts.
237 void Resize(int max_polys, int max_verts);
238
239 // Triangle creation routines
242
243 // vertex creation routines
244 void Begin_Vertex( void) {}
245
246 virtual void Location( float x, float y, float z);
247
248 // version for speedier use in certain cases
249 void Location_Inline( float x, float y, float z )
250 {
251 Vector3 * loc = Model->Get_Vertex_Array();
252 assert(loc);
253
254 loc[VertCount].X = x;
255 loc[VertCount].Y = y;
256 loc[VertCount].Z = z;
257 }
259
260 // retrieve a reference to the vertex in the object
261 // WARNING: does not validate index
262 Vector3 & Get_Location(int index) {
263 return Model->Get_Vertex_Array()[index];
264 }
265
266 void Normal( float x, float y, float z)
267 {
268 Vector3 * norms = Model->Get_Non_Const_Vertex_Normal_Array();
269 assert(norms);
270
271 norms[VertCount].X = x;
272 norms[VertCount].Y = y;
273 norms[VertCount].Z = z;
274 }
275 void Normal(Vector3 &v) { Normal(v.X,v.Y,v.Z); }
276
277 // retrieve a reference to the normal vector3 in the object
278 // WARNING: does not validate index
279 Vector3 & Get_Normal(int index) { return Model->Get_Non_Const_Vertex_Normal_Array()[index]; }
280
281 void Color(float r, float g, float b, float a, int color_array_index = 0)
282 {
283// Vector4 * color = Model->Get_Color_Array(color_array_index);
284 unsigned * color = Model->Get_Color_Array(color_array_index);
285 assert(color);
286
288// color[VertCount].X = r;
289// color[VertCount].Y = g;
290// color[VertCount].Z = b;
291// color[VertCount].W = a;
292 }
293 void Color(const Vector4 &v, int color_array_index = 0) { Color(v.X, v.Y, v.Z, v.W, color_array_index); }
294 void Color(unsigned v, int color_array_index=0)
295 {
296 unsigned * color = Model->Get_Color_Array(color_array_index);
297 assert(color);
298 color[VertCount]=v;
299 }
300
301 // retrieve a reference to a color entry in the object
302 // WARNING: does not validate index
303// Vector4 & Get_Color(int index, int color_array_index = 0) { return Model->Get_Color_Array(color_array_index)[index]; }
304 unsigned Get_Color(int index, int color_array_index = 0) { return Model->Get_Color_Array(color_array_index)[index]; }
305
306 void UV(float u, float v, int uv_array_index = 0)
307 {
308 Vector2 * uv = Model->Get_UV_Array(uv_array_index);
309 assert(uv);
310
311 uv[VertCount].U = u;
312 uv[VertCount].V = v;
313 }
314 void UV( Vector2 &v, int uv_array_index = 0) { UV(v.U, v.V, uv_array_index); }
315 // retrieve a reference to a UV entry in the object
316 // WARNING: does not validate index
317 Vector2 & Get_UV(int index, int uv_array_index = 0 )
318 {
319 return Model->Get_UV_Array(uv_array_index)[index];
320 }
321
322 bool End_Vertex( void);
323
324 // vertex creation shortcut, performs a begin, projected, rotated, and end
325 bool Vertex(float x, float y, float z, float u, float v)
326 {
327 Begin_Vertex();
328 Location(x, y, z);
329 UV(u, v);
330 return End_Vertex();
331 }
332
334 {
335 Begin_Vertex();
336 Location(v.X, v.Y, 0);
337 return End_Vertex();
338 }
339
340 void End_Tri_Strip( void )
341 {
342 TriVertexCount = 0;
343 }
344
345 void End_Tri_Fan( void )
346 {
347 TriVertexCount = 0;
348 }
349
350 // For moving a vertex after the DynaMesh has already been created.
351 virtual void Move_Vertex(int index, float x, float y, float z);
352 virtual void Get_Vertex(int index, float &x, float &y, float &z);
353
354 // For moving all vertices in the mesh by a fixed amount
355 void Translate_Vertices(const Vector3 & offset);
356
357 // For changing the color of a vertex after DynaMesh has been created.
358 virtual void Change_Vertex_Color(int index, const Vector4 &color, int color_array_index)
359 {
360 // check if switching to multivertexcolor
361 if (!MultiVertexColor[color_array_index]) {
362 Switch_To_Multi_Vertex_Color(color_array_index);
363 }
364 CurVertexColor[color_array_index].X = color.X;
365 CurVertexColor[color_array_index].Y = color.Y;
366 CurVertexColor[color_array_index].Z = color.Z;
367 CurVertexColor[color_array_index].W = color.W;
368// Vector4 * color_list = Model->Get_Color_Array(color_array_index);
369 unsigned * color_list = Model->Get_Color_Array(color_array_index);
370 color_list[index] = DX8Wrapper::Convert_Color_Clamp(color);
371 }
372
373
374 /*
375 ** The following are a bunch of inlined functions for setting & clearing the mesh model's various flags
376 */
377 // dirty flags
384
385 // control flags
386 void Disable_Sort(void) { Model->Set_Flag(MeshGeometryClass::SORT, false); }
387 void Enable_Sort(void) { Model->Set_Flag(MeshGeometryClass::SORT, true); }
388 bool Sort_Enabled(void) { return (Model->Get_Flag(MeshGeometryClass::SORT) != 0); }
389
392 bool Test_Bounding_Box(void) { return (Model->Get_Flag(MeshGeometryClass::DISABLE_BOUNDING_BOX) == 0); }
393
397
398 // this is called by the Reset function
400
401 enum {
404 };
405
406 // USER BE WARNED: This hack is only here because DynamicMeshClass does not expose all of the
407 // features that DynamicMeshModel provides. It may be dangerous to modify the model behind the
408 // DynamicMeshClass's back so use at your own risk!
410
411protected:
412
413 inline void Switch_To_Multi_Vertex_Color(int color_array_index = 0);
414
415 // tells when the triangle needs to be back flipped
416 virtual bool Flip_Face( void) { return (!(TriVertexCount & 1)); }
417
418 // Low-level mesh object
420
425
428
429 // number of polygons in the mesh
431
432 // number of vertices in the mesh
434
435 // triangle vertex number
437
438 // base vertex when submitting fans
440
441 // is user currently submitting strips or fans
444
445 // The static sort level
447};
448
456
461
463{
464 if (!Bounding_Volumes_Valid()) {
465 Model->Compute_Bounds(NULL);
466 }
467 Model->Get_Bounding_Sphere(&sphere);
468}
469
471{
472 if (!Bounding_Volumes_Valid()) {
473 Model->Compute_Bounds(NULL);
474 }
475 Model->Get_Bounding_Box(&box);
476}
477
478/*
479**
480*/
482{
483/* Vector4 * color_list = Model->Get_Color_Array(color_array_index);
484 // set the proper color for all the existing vertices
485 for (int lp = 0; lp < VertCount; lp++) {
486 color_list[lp].X = CurVertexColor[color_array_index].X;
487 color_list[lp].Y = CurVertexColor[color_array_index].Y;
488 color_list[lp].Z = CurVertexColor[color_array_index].Z;
489 color_list[lp].W = CurVertexColor[color_array_index].W;
490 }
491*/
492 unsigned * color_list = Model->Get_Color_Array(color_array_index);
493 // set the proper color for all the existing vertices
494 unsigned vertex_color=DX8Wrapper::Convert_Color_Clamp(CurVertexColor[color_array_index]);
495 for (int lp = 0; lp < VertCount; lp++) {
496 color_list[lp]=vertex_color;
497 }
498
499 MultiVertexColor[color_array_index] = true;
500}
501
502/*
503** Set the color of all vertices in the mesh for one color_array_index
504*/
505int DynamicMeshClass::Set_Vertex_Color(const Vector4 & color, int color_array_index)
506{
507 // check if switching to multivertexcolor
508 if (!MultiVertexColor[color_array_index]) {
509 Switch_To_Multi_Vertex_Color(color_array_index);
510 }
511
512 CurVertexColor[color_array_index] = color;
513 return 0;
514}
515
516int DynamicMeshClass::Set_Vertex_Color(const Vector3 & color, int color_array_index)
517{
518 Set_Vertex_Color(Vector4(color.X,color.Y,color.Z,1),color_array_index);
519 return 0;
520}
521
522
523/*
524** Dynamic Screen Meshes
525**
526** Same as DynamicMesh, but mapped in Screen Coordinates
527**
528** Screen -> 0,0 1,0
529** +---+
530** | |
531** +---+
532** 0,1 1,1
533**
534**
535** View -> -1,1 1,1
536** +---+
537** | |
538** +---+
539** -1,-1 1,-1
540**
541** Note: since y is inverted, it switches from right handed to left handed
542** (from counter-clockwise to clockwise), so Flip Face accounts for this
543*/
545
546public:
547 // constructor and destructor
548 DynamicScreenMeshClass( int max_poly, int max_vert, float aspect = 1.0f ) : DynamicMeshClass( max_poly, max_vert), Aspect( aspect ) {}
550 virtual ~DynamicScreenMeshClass( void) {}
551
552 // function to clone a dynamic screen mesh class
553 virtual RenderObjClass * Clone(void) const { return NEW_REF( DynamicScreenMeshClass, (*this)); }
554
555 // class id of this render object
556 virtual int Class_ID(void) const { return CLASSID_DYNASCREENMESH; }
557
558 // Remap locations to match a screen
559 virtual void Location( float x, float y, float z = 0.0f);
560
561 // For moving a vertex after the DynaMesh has already been created.
562 virtual void Move_Vertex(int index, float x, float y, float z = 0.0f);
563
564 // Set position
565 virtual void Set_Position(const Vector3 &v);
566
567 virtual void Reset( void);
568
569 virtual void Set_Aspect(float aspect) { Aspect=aspect; };
570
571protected:
572
573 // Aspect Ratio of the virtual screen.
574 // 1.0 gives a -1,-1 to 1,1 display
575 // 3/4 givs a -1,-3/4 to 1,3/4 display
576 float Aspect;
577
578 // tells when the triangle needs to be back flipped
579 virtual bool Flip_Face( void) { return !DynamicMeshClass::Flip_Face(); }
580};
581
582#endif // DYNAMESH
#define NULL
Definition BaseType.h:92
#define WWASSERT
#define SORT_LEVEL_NONE
Definition w3d_file.h:1195
#define W3DMPO_GLUE(ARGCLASS)
Definition always.h:120
static unsigned int Convert_Color_Clamp(const Vector4 &color)
void UV(float u, float v, int uv_array_index=0)
Definition dynamesh.h:306
bool Vertex(Vector2 v)
Definition dynamesh.h:333
void Reset_Native_Mesh()
Definition dynamesh.h:207
virtual void Location(float x, float y, float z)
Definition dynamesh.cpp:629
virtual int Get_Sort_Level(void) const
Definition dynamesh.h:163
void Enable_Bounding_Sphere(void)
Definition dynamesh.h:395
DynamicMeshClass(int max_poly, int max_vert)
Definition dynamesh.cpp:521
Vector3 & Get_Location(int index)
Definition dynamesh.h:262
void Location_Inline(Vector3 &v)
Definition dynamesh.h:258
void Normal(float x, float y, float z)
Definition dynamesh.h:266
bool End_Vertex(void)
Definition dynamesh.cpp:440
virtual void Get_Vertex(int index, float &x, float &y, float &z)
Definition dynamesh.cpp:654
void Color(float r, float g, float b, float a, int color_array_index=0)
Definition dynamesh.h:281
int TextureIdx[MAX_PASSES]
Definition dynamesh.h:423
virtual RenderObjClass * Clone(void) const
Definition dynamesh.cpp:624
bool Test_Bounding_Box(void)
Definition dynamesh.h:392
virtual int Get_Num_Polys(void) const
Definition dynamesh.h:157
bool Sort_Enabled(void)
Definition dynamesh.h:388
void Clear_Dirty_Bounds(void)
Definition dynamesh.h:379
void Normal(Vector3 &v)
Definition dynamesh.h:275
void Set_Dirty_Bounds(void)
Definition dynamesh.h:378
virtual void Render(RenderInfoClass &rinfo)
Definition dynamesh.cpp:415
void Begin_Tri_Fan(void)
Definition dynamesh.h:241
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
Definition dynamesh.h:462
void Reset_Mesh_Counters()
Definition dynamesh.h:210
int VertexMaterialIdx[MAX_PASSES]
Definition dynamesh.h:421
int Get_Pass_Count()
Definition dynamesh.h:176
void Color(const Vector4 &v, int color_array_index=0)
Definition dynamesh.h:293
bool MultiVertexMaterial[MAX_PASSES]
Definition dynamesh.h:422
void Switch_To_Multi_Vertex_Color(int color_array_index=0)
Definition dynamesh.h:481
unsigned Get_Color(int index, int color_array_index=0)
Definition dynamesh.h:304
bool Vertex(float x, float y, float z, float u, float v)
Definition dynamesh.h:325
void Disable_Sort(void)
Definition dynamesh.h:386
bool MultiTexture[MAX_PASSES]
Definition dynamesh.h:424
virtual void Reset(void)
Definition dynamesh.h:220
void UV(Vector2 &v, int uv_array_index=0)
Definition dynamesh.h:314
virtual int Get_Num_Vertices(void) const
Definition dynamesh.h:160
void Disable_Bounding_Sphere(void)
Definition dynamesh.h:394
virtual void Set_Material_Info(MaterialInfoClass *mat_info)
Definition dynamesh.h:153
bool MultiVertexColor[MAX_COLOR_ARRAYS]
Definition dynamesh.h:427
void Clear_Dirty_Vertex_Normals(void)
Definition dynamesh.h:383
Vector4 CurVertexColor[MAX_COLOR_ARRAYS]
Definition dynamesh.h:426
void Translate_Vertices(const Vector3 &offset)
Definition dynamesh.cpp:667
void Set_Pass_Count(int passes)
Definition dynamesh.h:175
void Disable_Bounding_Box(void)
Definition dynamesh.h:390
void Location_Inline(float x, float y, float z)
Definition dynamesh.h:249
int Set_Vertex_Color(const Vector4 &color, int color_array_index=0)
Definition dynamesh.h:505
void Resize(int max_polys, int max_verts)
Definition dynamesh.cpp:603
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
Definition dynamesh.h:470
void Reset_Flags()
Definition dynamesh.h:204
virtual bool Flip_Face(void)
Definition dynamesh.h:416
DynamicMeshModel * Model
Definition dynamesh.h:419
void Set_Dirty(void)
Definition dynamesh.h:399
Vector3 & Get_Normal(int index)
Definition dynamesh.h:279
void End_Tri_Fan(void)
Definition dynamesh.h:345
void Enable_Bounding_Box(void)
Definition dynamesh.h:391
DynamicMeshModel * Peek_Model(void)
Definition dynamesh.h:409
void Enable_Sort(void)
Definition dynamesh.h:387
virtual void Move_Vertex(int index, float x, float y, float z)
Definition dynamesh.cpp:642
bool Test_Bounding_Sphere(void)
Definition dynamesh.h:396
virtual ~DynamicMeshClass(void)
Definition dynamesh.cpp:619
void Begin_Vertex(void)
Definition dynamesh.h:244
int Set_Shader(const ShaderClass &shader, int pass=0)
Definition dynamesh.h:183
int Set_Texture(int idx, int pass=0)
Definition dynamesh.cpp:743
void Set_Dirty_Vertex_Normals(void)
Definition dynamesh.h:382
void Color(unsigned v, int color_array_index=0)
Definition dynamesh.h:294
virtual MaterialInfoClass * Get_Material_Info(void)
Definition dynamesh.h:152
void Set_Dirty_Planes(void)
Definition dynamesh.h:380
virtual MaterialInfoClass * Peek_Material_Info(void)
Definition dynamesh.h:151
virtual void Set_Sort_Level(int level)
Definition dynamesh.h:164
int Set_Vertex_Material(int idx, int pass=0)
Definition dynamesh.cpp:681
void Begin_Tri_Strip(void)
Definition dynamesh.h:240
virtual int Class_ID(void) const
Definition dynamesh.h:148
void Clear_Dirty_Planes(void)
Definition dynamesh.h:381
Vector2 & Get_UV(int index, int uv_array_index=0)
Definition dynamesh.h:317
void Set_Polygon_Info(const PolygonInfoClass &polyInfo, bool dont_search_texture=false, bool dont_search_vertex_material=false, int pass=0)
Definition dynamesh.h:186
void End_Tri_Strip(void)
Definition dynamesh.h:340
virtual void Change_Vertex_Color(int index, const Vector4 &color, int color_array_index)
Definition dynamesh.h:358
void Set_Pass_Count(int passes)
Definition dynamesh.h:95
void Set_Counts(int pnum, int vnum)
Definition dynamesh.h:82
void Initialize_Texture_Array(int pass, int stage, TextureClass *texture=NULL)
Definition dynamesh.cpp:399
void Set_Material_Info(MaterialInfoClass *mat_info)
Definition dynamesh.h:105
void Set_Single_Material(VertexMaterialClass *vmat, int pass=0)
Definition dynamesh.h:88
unsigned * Get_Color_Array(int color_array_index)
Definition dynamesh.h:85
virtual void Compute_Vertex_Normals(void)
Definition dynamesh.cpp:133
Vector3 * Get_Non_Const_Vertex_Normal_Array(void)
Definition dynamesh.h:449
DynamicMeshModel(unsigned int max_polys, unsigned int max_verts)
Definition dynamesh.cpp:52
void Reset(void)
Definition dynamesh.cpp:167
virtual void Compute_Plane_Equations(void)
Definition dynamesh.cpp:114
virtual void Compute_Bounds(Vector3 *verts)
Definition dynamesh.cpp:152
void Set_Shader(int pidx, ShaderClass shader, int pass=0)
Definition dynamesh.h:93
~DynamicMeshModel(void)
Definition dynamesh.cpp:105
void Set_Single_Shader(ShaderClass shader, int pass=0)
Definition dynamesh.h:90
void Set_Single_Texture(TextureClass *tex, int pass=0, int stage=0)
Definition dynamesh.h:89
TriIndex * Get_Non_Const_Polygon_Array(void)
Definition dynamesh.h:457
Vector2 * Get_UV_Array(int uv_array_index)
Definition dynamesh.h:86
void Set_Texture(int pidx, TextureClass *tex, int pass=0, int stage=0)
Definition dynamesh.h:94
void Set_Material(int vidx, VertexMaterialClass *vmat, int pass=0)
Definition dynamesh.h:92
void Initialize_Material_Array(int pass, VertexMaterialClass *vmat=NULL)
Definition dynamesh.cpp:407
MaterialInfoClass * Get_Material_Info(void)
Definition dynamesh.h:104
MaterialInfoClass * Peek_Material_Info(void)
Definition dynamesh.h:103
int Get_Pass_Count(void) const
Definition dynamesh.h:96
void Render(RenderInfoClass &rinfo)
Definition dynamesh.cpp:178
virtual void Location(float x, float y, float z=0.0f)
Definition dynamesh.cpp:810
DynamicScreenMeshClass(int max_poly, int max_vert, float aspect=1.0f)
Definition dynamesh.h:548
DynamicScreenMeshClass(const DynamicScreenMeshClass &src)
Definition dynamesh.h:549
virtual int Class_ID(void) const
Definition dynamesh.h:556
virtual RenderObjClass * Clone(void) const
Definition dynamesh.h:553
virtual void Set_Aspect(float aspect)
Definition dynamesh.h:569
virtual void Set_Position(const Vector3 &v)
Definition dynamesh.cpp:822
virtual bool Flip_Face(void)
Definition dynamesh.h:579
virtual void Move_Vertex(int index, float x, float y, float z=0.0f)
Definition dynamesh.cpp:816
virtual void Reset(void)
Definition dynamesh.cpp:827
virtual ~DynamicScreenMeshClass(void)
Definition dynamesh.h:550
TriIndex * get_polys(void)
int Get_Flag(FlagsType flag)
Vector3 * get_vert_normals(void)
ShaderClass * Peek_Shader() const
Definition polyinfo.h:64
TextureClass * Peek_Texture() const
Definition polyinfo.h:62
VertexMaterialClass * Peek_Vertex_Material() const
Definition polyinfo.h:63
void Add_Ref(void) const
Definition refcount.cpp:171
RenderObjClass(void)
Definition rendobj.cpp:170
bool Bounding_Volumes_Valid(void) const
Definition rendobj.h:522
@ CLASSID_DYNASCREENMESH
Definition rendobj.h:209
float V
Definition vector2.h:80
float Y
Definition vector2.h:79
float X
Definition vector2.h:74
float U
Definition vector2.h:75
float X
Definition vector3.h:90
float Z
Definition vector3.h:92
float Y
Definition vector3.h:91
float Y
Definition vector4.h:67
float Z
Definition vector4.h:68
float X
Definition vector4.h:66
float W
Definition vector4.h:69
Vector3i16 TriIndex
#define NEW_REF(C, P)
Definition refcount.h:62