Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
shdmesh.cpp
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 : WWShade *
24 * *
25 * $Archive:: wwshade/shdmesh.cpp $*
26 * *
27 * Org Author:: Jani P *
28 * *
29 * Author : Kenny Mitchell *
30 * *
31 * $Modtime:: 07/12/02 10:31a $*
32 * *
33 * $Revision:: 1 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 *---------------------------------------------------------------------------------------------*/
37
38#include "shdmesh.h"
39#include "shdsubmesh.h"
40#include "shdrenderer.h"
41#include "rinfo.h"
42#include "camera.h"
43#include "dx8wrapper.h"
44#include "wwdebug.h"
45#include "wwprofile.h"
46#include "mesh.h"
47#include "meshmdl.h"
48
55
57: RenderObjClass(src),
58 Name(src.Name),
61{
62 Free();
63 SubMeshes.Resize(src.SubMeshes.Length());
64 for (int i=0;i<SubMeshes.Length();++i)
65 {
66 SubMeshes[i].Mesh=NULL;
67 SubMeshes[i].Renderer=NULL;
68 REF_PTR_SET(SubMeshes[i].Mesh,src.SubMeshes[i].Mesh);
69 }
70}
71
73{
74 Free();
75 // TODO TODO TODO!!!!!
76}
77
79{
80 return new ShdMeshClass(*this);
81}
82
83const char * ShdMeshClass::Get_Name() const
84{
85 return Name;
86}
87
88void ShdMeshClass::Set_Name(const char * name)
89{
90 Name = name;
91}
92
93/***********************************************************************************************
94 * ShdMeshClass::Free -- Releases all memory/assets in use by this mesh *
95 * *
96 * INPUT: *
97 * *
98 * OUTPUT: *
99 * *
100 * WARNINGS: *
101 * *
102 * HISTORY: *
103 * 1/6/98 GTH : Created. *
104 *=============================================================================================*/
106{
107 for (int i=0;i<SubMeshes.Length();++i)
108 {
109 REF_PTR_RELEASE(SubMeshes[i].Mesh);
110 if (SubMeshes[i].Renderer)
111 {
112 delete SubMeshes[i].Renderer;
113 SubMeshes[i].Renderer=NULL;
114 }
115 }
116}
117
119{
120 int count = 0;
121 for (int i=0; i<SubMeshes.Length(); i++)
122 {
123 count+= SubMeshes[i].Mesh->Get_Polygon_Count();
124 }
125 return count;
126}
127
129{
130 int count = 0;
131 for (int i=0; i<SubMeshes.Length(); i++)
132 {
133 count+= SubMeshes[i].Mesh->Get_Vertex_Count();
134 }
135 return count;
136}
137
138
140{
141 WWPROFILE("ShdMeshClass::Render");
142 if (Is_Not_Hidden_At_All() == false)
143 {
144 return;
145 }
146
147// DX8_RECORD_MESH_RENDER();
148
149 // TODO: Static sort lists
151 const FrustumClass & frustum=rinfo.Camera.Get_Frustum();
152
153 // if rendering shadow remember camera info
155 {
156 // is generating shadow map
158
159 // set texture projector
161
163 }
164 else if (Is_Self_Shadowed())
165 {
166 // is applying shadow map
169 }
170 else
171 {
173 }
174
175
176 // TODO: What to do with SKINS?
177 if (1)//CollisionMath::Overlap_Test(frustum,Get_Bounding_Box())!=CollisionMath::OUTSIDE )
178 {
179// bool rendered_something = false;
180
181 // TODO: Override flags, decals and material passes (probably in the submesh rendering)
182 for (int i=0;i<SubMeshes.Length();++i)
183 {
184 if (!SubMeshes[i].Renderer)
185 {
187 }
188
189 SubMeshes[i].Renderer->Render(rinfo);
190 }
191
192 // TODO: RendererDebugger
193 }
194
195
196}
197
198//void ShdMeshClass::Render_Material_Pass(MaterialPassClass * pass,IndexBufferClass * ib)
199//{
200//
201//}
202
206
207/***********************************************************************************************
208 * ShdMeshClass::Cast_Ray -- compute a ray intersection with this mesh *
209 * *
210 * INPUT: *
211 * *
212 * OUTPUT: *
213 * *
214 * WARNINGS: *
215 * *
216 * HISTORY: *
217 * 6/17/98 GTH : Created. *
218 *=============================================================================================*/
220{
221 if ((Get_Collision_Type() & raytest.CollisionType) == 0) return false;
222 if ((Is_Translucent()!=0) && (!raytest.CheckTranslucent)) return false;
223 if (Is_Animation_Hidden()) return false;
224 if (raytest.Result->StartBad) return false;
225
226 Matrix3D world_to_obj;
227 Matrix3D world=Get_Transform();
228
229 // if aligned or oriented rotate the mesh so that it's aligned to the ray
230/* if (Model->Get_Flag(MeshModelClass::ALIGNED)) {
231 Vector3 mesh_position;
232 world.Get_Translation(&mesh_position);
233 world.Obj_Look_At(mesh_position,mesh_position - raytest.Ray.Get_Dir(),0.0f);
234 } else if (Model->Get_Flag(MeshModelClass::ORIENTED)) {
235 Vector3 mesh_position;
236 world.Get_Translation(&mesh_position);
237 world.Obj_Look_At(mesh_position,raytest.Ray.Get_P0(),0.0f);
238 }
239*/
240 world.Get_Orthogonal_Inverse(world_to_obj);
241 RayCollisionTestClass objray(raytest,world_to_obj);
242
243 for (int i=0;i<SubMeshes.Length();++i) {
244 if (SubMeshes[i].Mesh->Cast_Ray(objray)) {
245 // transform result back into original coordinate system
246 raytest.CollidedRenderObj = this;
247 Matrix3D::Rotate_Vector(world,raytest.Result->Normal, &(raytest.Result->Normal));
248 if (raytest.Result->ComputeContactPoint) {
250 }
251 return true;
252 }
253 }
254
255 return false;
256}
257
258/***********************************************************************************************
259 * ShdMeshClass::Cast_AABox -- cast an AABox against this mesh *
260 * *
261 * INPUT: *
262 * *
263 * OUTPUT: *
264 * *
265 * WARNINGS: *
266 * *
267 * HISTORY: *
268 * 6/17/98 GTH : Created. *
269 *=============================================================================================*/
271{
272 if ((Get_Collision_Type() & boxtest.CollisionType) == 0) return false;
273 if (boxtest.Result->StartBad) return false;
274
275 for (int i=0;i<SubMeshes.Length();++i) {
276 // This function analyses the tranform to call optimized functions in certain cases
277 if (SubMeshes[i].Mesh->Cast_World_Space_AABox(boxtest, Get_Transform())) {
278 boxtest.CollidedRenderObj = this;
279 return true;
280 }
281 }
282
283 return false;
284}
285
286/***********************************************************************************************
287 * Cast_OBBox -- Cast an obbox against this mesh *
288 * *
289 * INPUT: *
290 * *
291 * OUTPUT: *
292 * *
293 * WARNINGS: *
294 * *
295 * HISTORY: *
296 * 6/17/98 GTH : Created. *
297 *=============================================================================================*/
299{
300 if ((Get_Collision_Type() & boxtest.CollisionType) == 0) return false;
301 if (boxtest.Result->StartBad) return false;
302
303 /*
304 ** transform into the local coordinate system of the mesh.
305 */
306 const Matrix3D & tm = Get_Transform();
307 Matrix3D world_to_obj;
308 tm.Get_Orthogonal_Inverse(world_to_obj);
309 OBBoxCollisionTestClass localtest(boxtest,world_to_obj);
310
311 for (int i=0;i<SubMeshes.Length();++i) {
312 if (SubMeshes[i].Mesh->Cast_OBBox(localtest)) {
313
314 /*
315 ** If we hit, transform the result of the test back to the original coordinate system.
316 */
317 boxtest.CollidedRenderObj = this;
318 Matrix3D::Rotate_Vector(tm,boxtest.Result->Normal, &(boxtest.Result->Normal));
319 if (boxtest.Result->ComputeContactPoint) {
321 }
322 return true;
323 }
324 }
325
326 return false;
327}
328
329/***********************************************************************************************
330 * ShdMeshClass::Intersect_AABox -- test for intersection with given AABox *
331 * *
332 * The AAbox given is assumed to be in world space. Since meshes aren't generally in world *
333 * space, the test must be transformed into our local coordinate system (which turns it into *
334 * an OBBox...) *
335 * *
336 * INPUT: *
337 * *
338 * OUTPUT: *
339 * *
340 * WARNINGS: *
341 * *
342 * HISTORY: *
343 * 1/19/00 gth : Created. *
344 *=============================================================================================*/
346{
347 if ((Get_Collision_Type() & boxtest.CollisionType) == 0) return false;
348
349 Matrix3D inv_tm;
351 OBBoxIntersectionTestClass local_test(boxtest,inv_tm);
352
353 for (int i=0;i<SubMeshes.Length();++i) {
354 if (SubMeshes[i].Mesh->Intersect_OBBox(local_test)) return true;
355 }
356 return false;
357}
358
359/***********************************************************************************************
360 * ShdMeshClass::Intersect_OBBox -- test for intersection with the given OBBox *
361 * *
362 * The given OBBox is assumed to be in world space so we need to transform it into the mesh's *
363 * local coordinate system. *
364 * *
365 * INPUT: *
366 * *
367 * OUTPUT: *
368 * *
369 * WARNINGS: *
370 * *
371 * HISTORY: *
372 * 1/19/00 gth : Created. *
373 *=============================================================================================*/
375{
376 if ((Get_Collision_Type() & boxtest.CollisionType) == 0) return false;
377
378 Matrix3D inv_tm;
380 OBBoxIntersectionTestClass local_test(boxtest,inv_tm);
381
382 for (int i=0;i<SubMeshes.Length();++i) {
383 if (SubMeshes[i].Mesh->Intersect_OBBox(local_test)) return true;
384 }
385 return false;
386}
387
388/***********************************************************************************************
389 * ShdMeshClass::Add_Dependencies_To_List -- Add dependent files to the list. *
390 * *
391 * INPUT: *
392 * *
393 * OUTPUT: *
394 * *
395 * WARNINGS: *
396 * *
397 * HISTORY: *
398 * 3/18/99 PDS : Created. *
399 * 6/05/02 KJM : Added dependency calculation for shader system
400 *=============================================================================================*/
402(
404 bool textures_only
405)
406{
407 // loop through sub meshes
408 for (int i=0;i<SubMeshes.Length();i++)
409 {
410 ShdInterfaceClass* shd=SubMeshes[i].Mesh->Peek_Shader();
411
412 for (int tidx=0;tidx<shd->Get_Texture_Count();tidx++)
413 {
414 TextureClass* texture=shd->Peek_Texture(tidx);
415 if (texture)
416 {
417 file_list.Add(texture->Get_Full_Path());
418 }
419 }
420 }
421
422 RenderObjClass::Add_Dependencies_To_List (file_list, textures_only);
423 return ;
424}
425
426/***********************************************************************************************
427 * ShdMeshClass::Update_Cached_Bounding_Volumes -- default collision sphere. *
428 * *
429 * INPUT: *
430 * *
431 * OUTPUT: *
432 * *
433 * WARNINGS: *
434 * *
435 * HISTORY: *
436 * 5/14/2001 NH : Created. *
437 *=============================================================================================*/
439{
441
443
444 // If we are camera-aligned or -oriented, we don't know which way we are facing at this point,
445 // so the box we return needs to contain the sphere. Otherewise do the normal computation.
446/* if (Model->Get_Flag(MeshModelClass::ALIGNED) || Model->Get_Flag(MeshModelClass::ORIENTED)) {
447 CachedBoundingBox.Center = CachedBoundingSphere.Center;
448 CachedBoundingBox.Extent.Set(CachedBoundingSphere.Radius, CachedBoundingSphere.Radius, CachedBoundingSphere.Radius);
449 } else {
451 CachedBoundingBox.Transform(Get_Transform());
452// }
453
455}
456
457/***********************************************************************************************
458 * ShdMeshClass::Get_Obj_Space_Bounding_Sphere -- returns obj-space bounding sphere *
459 * *
460 * INPUT: *
461 * *
462 * OUTPUT: *
463 * *
464 * WARNINGS: *
465 * *
466 * HISTORY: *
467 * 1/19/00 gth : Created. *
468 *=============================================================================================*/
470{
471 if (SubMeshes.Length()) {
472 SubMeshes[0].Mesh->Get_Bounding_Sphere(&sphere);
473 // If there are more than one submesh, merge all bounding spheres
474 for (int i=1;i<SubMeshes.Length();++i) {
475 SphereClass tmp_s;
476 SubMeshes[i].Mesh->Get_Bounding_Sphere(&tmp_s);
477 sphere+=tmp_s;
478 }
479 }
480 else {
481 sphere.Center.Set(0,0,0);
482 sphere.Radius = 1.0f;
483 }
484}
485
486/***********************************************************************************************
487 * ShdMeshClass::Get_Obj_Space_Bounding_Box -- returns the obj-space bounding box *
488 * *
489 * INPUT: *
490 * *
491 * OUTPUT: *
492 * *
493 * WARNINGS: *
494 * *
495 * HISTORY: *
496 * 1/19/00 gth : Created. *
497 *=============================================================================================*/
499{
500 if (SubMeshes.Length()) {
501 SubMeshes[0].Mesh->Get_Bounding_Box(&box);
502 // If there are more than one submesh, merge all bounding boxes
503 for (int i=1;i<SubMeshes.Length();++i) {
504 AABoxClass tmp_b;
505 SubMeshes[i].Mesh->Get_Bounding_Box(&tmp_b);
506
507 box.Add_Box(tmp_b);
508 }
509 }
510 else {
511 box.Init(Vector3(0,0,0),Vector3(1,1,1));
512 }
513}
514
516{
517 Set_Name(mesh->Get_Name());
518 MeshModelClass* model=mesh->Peek_Model();
519 if (model)
520 {
521 int first_poly=0;
522 int sub_mesh_count=0;
523 while (first_poly<model->Get_Polygon_Count()) {
524 sub_mesh_count++;
525 ShdSubMeshClass * sub_mesh = NEW_REF( ShdSubMeshClass, () );
526 sub_mesh->Init_From_Legacy_Mesh_Model(model,first_poly);
527 SubMeshes.Resize(sub_mesh_count);
528 SubMeshes[sub_mesh_count-1].Mesh=sub_mesh;
529 SubMeshes[sub_mesh_count-1].Renderer=NULL;
530 if (sub_mesh->Get_Visible_Polygon_Count()==0) break;
531 first_poly+=sub_mesh->Get_Visible_Polygon_Count();
532 }
533 }
534
535 // Pull interesting stuff out of the w3d attributes bits
537 Set_Hidden(mesh->Is_Hidden());
539}
540
541
542
543/***********************************************************************************************
544 * ShdMeshClass::Load -- creates a shader mesh out of a shader mesh chunk in a .w3d file *
545 * *
546 * INPUT: *
547 * *
548 * OUTPUT: *
549 * *
550 * WARNINGS: *
551 * *
552 * HISTORY: *
553 * 05/21/2002 KM : Created. *
554 *=============================================================================================*/
556{
557 // Open the first chunk, it should be the shader mesh name
558 cload.Open_Chunk();
559
561 {
562 WWDEBUG_SAY(("Invalid format shader mesh.\n"));
564 }
565
566 // read name
567 char buf[MAX_PATH];
568 cload.Read(buf,cload.Cur_Chunk_Length());
569 cload.Close_Chunk();
570 Set_Name(buf);
571
572 // open header
574 cload.Open_Chunk();
575 if
576 (
577 cload.Read
578 (
579 &hdr,
581 )!=sizeof(W3dShdMeshHeaderStruct)
582 )
583 {
585 }
586 cload.Close_Chunk();
587
588 // Process the header
589
590 // Set Bounding Info
591 Vector3 min(hdr.BoxMin.X,hdr.BoxMin.Y,hdr.BoxMin.Z);
592 Vector3 max(hdr.BoxMax.X,hdr.BoxMax.Y,hdr.BoxMax.Z);
593
594 CachedBoundingBox.Init_Min_Max(min,max);
595
596 Vector3 cntr(hdr.SphCenter.X,hdr.SphCenter.Y,hdr.SphCenter.Z);
597 CachedBoundingSphere.Init(cntr,hdr.SphRadius);
598
599 // Flags (todo)
600
601 // user text
602
603
604 // next are the sub meshes
605 Free();
606 SubMeshes.Resize(hdr.NumSubMeshes);
607 for (int i=0;i<SubMeshes.Length(); )
608 {
609 cload.Open_Chunk();
610
612 {
613 // todo
614 cload.Read(buf,cload.Cur_Chunk_Length());
615 }
616 else
617 {
619 if (ssmesh==NULL)
620 {
621 WWDEBUG_SAY(("ShdMeshClass::Load_W3D - Failed to allocate sub mesh\r\n"));
623 }
624
625 SubMeshes[i].Mesh=ssmesh;
626 SubMeshes[i].Renderer=NULL;
627 REF_PTR_SET(SubMeshes[i].Mesh,SubMeshes[i].Mesh);
628
629 ssmesh->Load_W3D(cload);
630
631 // assign each sub-mesh with a name in the format: <parentmesh>.<index>
632 StringClass tmp;
633 tmp.Format("%s.%d",Name,i);
634 ssmesh->Set_Name(tmp);
635
636 i++;
637 }
638
639 cload.Close_Chunk();
640 }
641
642 // Pull interesting stuff out of the w3d attributes bits
644 Set_Collision_Type( col_bits << 1 );
646
647 for (i=0;i<SubMeshes.Length(); i++) {
649 SubMeshes[i].Mesh->Set_Flag(MeshGeometryClass::CAST_SHADOW,shadow);
650 }
651
652 // Indicate whether this mesh is translucent. The mesh is considered translucent
653 // if sorting has been enabled (alpha blending on pass 0) or if pass0 contains alpha-test.
654 // This flag is used to determine if the mesh can cast a geometric shadow.
655 bool is_translucent = false;
656 for (i=0;i<SubMeshes.Length(); i++) {
657 if (SubMeshes[i].Mesh) {
658 if (SubMeshes[i].Mesh->Is_Sorting()) {
659 Set_Translucent(true);
660 }
661 ShdInterfaceClass * shader = SubMeshes[i].Mesh->Peek_Shader();
662 if ((shader) && (!shader->Is_Opaque())) {
663 Set_Translucent(true);
664 }
665 }
666 }
667
668 return WW3D_ERROR_OK;
669}
670
671
673{
674 return SubMeshes.Length();
675}
676
678{
679 return SubMeshes[i].Mesh;
680}
681
#define NULL
Definition BaseType.h:92
#define min(x, y)
Definition BaseType.h:101
#define max(x, y)
Definition BaseType.h:105
#define W3D_MESH_FLAG_COLLISION_TYPE_SHIFT
Definition w3d_file.h:1144
#define W3D_MESH_FLAG_HIDDEN
Definition w3d_file.h:1151
#define W3D_MESH_FLAG_CAST_SHADOW
Definition w3d_file.h:1155
@ W3D_CHUNK_SHDMESH_NAME
Definition w3d_file.h:492
@ W3D_CHUNK_SHDMESH_USER_TEXT
Definition w3d_file.h:494
#define W3D_MESH_FLAG_COLLISION_TYPE_MASK
Definition w3d_file.h:1143
@ false
Definition bool.h:59
WWINLINE void Init(const Vector3 &center, const Vector3 &extent)
Definition aabox.h:101
void Add_Box(const AABoxClass &b)
Definition aabox.h:389
const FrustumClass & Get_Frustum(void) const
Definition camera.h:339
bool Close_Chunk()
Definition chunkio.cpp:448
uint32 Cur_Chunk_ID()
Definition chunkio.cpp:484
uint32 Cur_Chunk_Length()
Definition chunkio.cpp:503
uint32 Read(void *buf, uint32 nbytes)
Definition chunkio.cpp:692
bool Open_Chunk()
Definition chunkio.cpp:412
CastResultStruct * Result
Definition coltest.h:98
RenderObjClass * CollidedRenderObj
Definition coltest.h:100
bool Add(T const &object)
Definition Vector.H:671
Vector3 Rotate_Vector(const Vector3 &vect) const
Definition matrix3d.cpp:300
void Get_Orthogonal_Inverse(Matrix3D &set_inverse) const
Definition matrix3d.cpp:570
static WWINLINE void Transform_Vector(const Matrix3D &tm, const Vector3 &in, Vector3 *out)
Definition matrix3d.h:1742
virtual const char * Get_Name(void) const
Definition mesh.cpp:324
MeshModelClass * Peek_Model(void)
Definition mesh.h:195
void Set_Name(const char *newname)
TexProjectClass * Texture_Projector
Definition rinfo.h:111
CameraClass & Camera
Definition rinfo.h:100
RINFO_OVERRIDE_FLAGS & Current_Override_Flags(void)
Definition rinfo.cpp:126
@ RINFO_OVERRIDE_SHADOW_RENDERING
Definition rinfo.h:87
LightEnvironmentClass * light_environment
Definition rinfo.h:109
virtual int Is_Hidden(void) const
Definition rendobj.h:471
virtual int Is_Animation_Hidden(void) const
Definition rendobj.h:473
virtual int Is_Translucent(void) const
Definition rendobj.h:478
void Validate_Cached_Bounding_Volumes(void) const
Definition rendobj.h:524
virtual int Is_Not_Hidden_At_All(void)
Definition rendobj.h:463
RenderObjClass(void)
Definition rendobj.cpp:170
virtual void Set_Translucent(int onoff)
Definition rendobj.h:479
AABoxClass CachedBoundingBox
Definition rendobj.h:553
void Unset_Is_Self_Shadowed()
Definition rendobj.h:501
virtual void Set_Collision_Type(int type)
Definition rendobj.h:485
void Set_Is_Self_Shadowed()
Definition rendobj.h:500
virtual void Set_Hidden(int onoff)
Definition rendobj.h:472
int Is_Self_Shadowed() const
Definition rendobj.h:502
virtual void Add_Dependencies_To_List(DynamicVectorClass< StringClass > &file_list, bool textures_only=false)
Definition rendobj.cpp:1136
const Matrix3D & Get_Transform(void) const
Definition rendobj.h:617
virtual int Get_Collision_Type(void) const
Definition rendobj.h:484
SphereClass CachedBoundingSphere
Definition rendobj.h:552
virtual bool Is_Opaque(void) const
virtual TextureClass * Peek_Texture(int idx) const =0
virtual int Get_Texture_Count() const =0
virtual bool Intersect_AABox(AABoxIntersectionTestClass &boxtest)
Definition shdmesh.cpp:345
int Get_Num_Vertices(void) const
Definition shdmesh.cpp:128
void Init_From_Legacy_Mesh(MeshClass *mesh)
Definition shdmesh.cpp:515
virtual RenderObjClass * Clone(void) const
Definition shdmesh.cpp:78
virtual bool Cast_AABox(AABoxCollisionTestClass &boxtest)
Definition shdmesh.cpp:270
ShdSubMeshClass * Peek_Sub_Mesh(int i) const
Definition shdmesh.cpp:677
LightEnvironmentClass * LightEnvironment
Definition shdmesh.h:181
virtual void Update_Cached_Bounding_Volumes(void) const
Definition shdmesh.cpp:438
void Unset_Is_Applying_Shadow_Map()
Definition shdmesh.h:163
void Set_Lighting_Environment(LightEnvironmentClass *light_env)
Definition shdmesh.h:132
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass &boxtest)
Definition shdmesh.cpp:374
SimpleVecClass< ShdSubMeshStruct > SubMeshes
Definition shdmesh.h:180
virtual int Get_Num_Polys(void) const
Definition shdmesh.cpp:118
virtual void Add_Dependencies_To_List(DynamicVectorClass< StringClass > &file_list, bool textures_only=false)
Definition shdmesh.cpp:402
virtual bool Cast_Ray(RayCollisionTestClass &raytest)
Definition shdmesh.cpp:219
virtual void Render(RenderInfoClass &rinfo)
Definition shdmesh.cpp:139
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
Definition shdmesh.cpp:469
virtual void Set_Name(const char *name)
Definition shdmesh.cpp:88
virtual bool Cast_OBBox(OBBoxCollisionTestClass &boxtest)
Definition shdmesh.cpp:298
int Get_Sub_Mesh_Count(void) const
Definition shdmesh.cpp:672
virtual ~ShdMeshClass(void)
Definition shdmesh.cpp:72
WW3DErrorType Load_W3D(ChunkLoadClass &cload)
Definition shdmesh.cpp:555
virtual void Special_Render(SpecialRenderInfoClass &rinfo)
Definition shdmesh.cpp:203
bool Applying_Shadow_Map
Definition shdmesh.h:182
TexProjectClass * Texture_Projector
Definition shdmesh.h:183
void Free(void)
Definition shdmesh.cpp:105
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
Definition shdmesh.cpp:498
StringClass Name
Definition shdmesh.h:179
ShdMeshClass(void)
Definition shdmesh.cpp:49
virtual const char * Get_Name(void) const
Definition shdmesh.cpp:83
void Set_Is_Applying_Shadow_Map()
Definition shdmesh.h:162
virtual ShdRendererNodeClass * Register_Mesh(ShdMeshClass *mesh, ShdSubMeshClass *sub_mesh)=0
static ShdRendererClass * Peek_Instance()
void Init_From_Legacy_Mesh_Model(MeshModelClass *model, int first_polygon)
WW3DErrorType Load_W3D(ChunkLoadClass &cload)
int Get_Visible_Polygon_Count() const
Definition shdsubmesh.h:103
int Length(void) const
Definition simplevec.h:83
float Radius
Definition sphere.h:91
Vector3 Center
Definition sphere.h:90
int _cdecl Format(const TCHAR *format,...)
Definition wwstring.cpp:273
const StringClass & Get_Full_Path(void) const
Definition texture.h:113
WWINLINE void Set(float x, float y, float z)
Definition vector3.h:103
else return(RetVal)
#define REF_PTR_RELEASE(x)
Definition refcount.h:80
#define REF_PTR_SET(dst, src)
Definition refcount.h:79
#define NEW_REF(C, P)
Definition refcount.h:62
Vector3 ContactPoint
Definition castres.h:70
bool ComputeContactPoint
Definition castres.h:69
Vector3 Normal
Definition castres.h:66
W3dVectorStruct BoxMin
Definition w3d_file.h:2212
W3dVectorStruct SphCenter
Definition w3d_file.h:2214
W3dVectorStruct BoxMax
Definition w3d_file.h:2213
WW3DErrorType
Definition w3derr.h:51
@ WW3D_ERROR_LOAD_FAILED
Definition w3derr.h:54
@ WW3D_ERROR_OK
Definition w3derr.h:52
#define WWDEBUG_SAY(x)
Definition wwdebug.h:114
#define WWPROFILE(name)
Definition wwprofile.h:270