Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
rendobj.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/* $Header: /Commando/Code/ww3d2/rendobj.cpp 16 12/17/01 8:06p Byon_g $ */
20/***********************************************************************************************
21 *** Confidential - Westwood Studios ***
22 ***********************************************************************************************
23 * *
24 * Project Name : Commando / G 3D Engine *
25 * *
26 * $Archive:: /Commando/Code/ww3d2/rendobj.cpp $*
27 * *
28 * Org Author:: Greg_h *
29 * *
30 * Author : Kenny Mitchell *
31 * *
32 * $Modtime:: 07/01/02 12:45p $*
33 * *
34 * $Revision:: 17 $*
35 * *
36 * 07/01/02 KM Coltype enum change to avoid MAX conflicts *
37 *---------------------------------------------------------------------------------------------*
38 * Functions: *
39 * RenderObjClass::RenderObjClass -- constructor *
40 * RenderObjClass::RenderObjClass -- copy constructor *
41 * RenderObjClass::operator == -- assignment operator *
42 * RenderObjClass::Calculate_Texture_Reduction_Factor -- calculate texture reduction factor *
43 * RenderObjClass::Set_Texture_Reduction_Factor -- set texture reduction factor. *
44 * RenderObjClass::Get_Screen_Size -- get normalized area of object. *
45 * RenderObjClass::Get_Scene -- returns the (add_ref'd) scene pointer *
46 * RenderObjClass::Set_Container -- sets the container pointer *
47 * RenderObjClass::Get_Container -- returns the container pointer *
48 * RenderObjClass::Set_Transform -- set the transform for this object *
49 * RenderObjClass::Set_Position -- Sets the position of this object *
50 * RenderObjClass::Get_Transform -- returns the transform for the object *
51 * RenderObjClass::Get_Position -- returns the position of this render object *
52 * RenderObjClass::Validate_Transform -- If the transform is dirty, this causes it to be re- *
53 * RenderObjClass::Get_Sub_Object -- returns pointer to first sub-obj with given name *
54 * RenderObjClass::Add_Sub_Object_To_Bone -- add an object to a named bone *
55 * RenderObjClass::Prepare_LOD -- prepare object for predictive and texture LOD processing. *
56 * RenderObjClass::Get_Cost -- get object rendering cost for predictive LOD processing. *
57 * RenderObjClass::Update_Sub_Object_Bits -- updates our bits according to our sub-objects *
58 * RenderObjClass::Update_Sub_Object_Transforms -- re-evaluate the transforms my sub-objects *
59 * RenderObjClass::Add -- Generic add for render objects *
60 * RenderObjClass::Remove -- Generic Remove for Render Objects *
61 * RenderObjClass::Notify_Added -- notifies the object that it is in a scene *
62 * RenderObjClass::Notify_Removed -- notifies an object that it has been removed *
63 * RenderObjClass::Update_Cached_Bounding_Volumes -- default collision sphere. *
64 * RenderObjClass::Get_Obj_Space_Bounding_Sphere -- default collision sphere. *
65 * RenderObjClass::Get_Obj_Space_Bounding_Box -- default collision box. *
66 * RenderObjClass::Intersect - Returns true if specified intersection object *
67 * RenderObjClass::Intersect_Sphere -- tests for intersection with the bounding sphere *
68 * RenderObjClass::Intersect_Sphere_Quick -- tests for intersection with the bounding sphere *
69 * RenderObjClass::Build_Dependency_List -- Generates a list of files this obj depends on. *
70 * RenderObjClass::Build_Texture_List -- Builds a list of texture files this obj depends on. *
71 * RenderObjClass::Add_Dependencies_To_List -- Add dependent files to the list. *
72 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
73
74
75#include "rendobj.h"
76#include "assetmgr.h"
77#include "_mono.h"
78#include "bsurface.h"
79#include "pot.h"
80#include "scene.h"
81#include "colmath.h"
82#include "coltest.h"
83#include "inttest.h"
84#include "wwdebug.h"
85#include "matinfo.h"
86#include "htree.h"
87#include "predlod.h"
88#include "camera.h"
89#include "ww3d.h"
90#include "chunkio.h"
91#include "persistfactory.h"
92#include "saveload.h"
93#include "ww3dids.h"
94#include "intersec.h"
95
96
97#ifdef _INTERNAL
98// for occasional debugging...
99//#pragma optimize("", off)
100//#pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
101#endif
102
103// Definitions of static members:
104const float RenderObjClass::AT_MIN_LOD = FLT_MAX;
105const float RenderObjClass::AT_MAX_LOD = -1.0f;
106
107// Local inline functions
109Filename_From_Asset_Name (const char *asset_name)
110{
111 StringClass filename;
112 if (asset_name != NULL) {
113
114 //
115 // Copy the model name into a new filename buffer
116 //
117 ::lstrcpy (filename.Get_Buffer (::lstrlen (asset_name) + 5), asset_name);
118
119 //
120 // Do we need to strip off the model's suffix?
121 //
122 char *suffix = ::strchr (filename, '.');
123 if (suffix != NULL) {
124 suffix[0] = 0;
125 }
126
127 //
128 // Concat the w3d file extension
129 //
130 filename += ".w3d";
131 }
132
133 return filename;
134}
135
136static inline bool Check_Is_Transform_Identity(const Matrix3D& m)
137{
138 const float zero=0.0f;
139 const float one=1.0f;
140
141 unsigned d=
142 ((unsigned&)m[0][0]^(unsigned&)one) |
143 ((unsigned&)m[0][1]^(unsigned&)zero) |
144 ((unsigned&)m[0][2]^(unsigned&)zero) |
145 ((unsigned&)m[0][3]^(unsigned&)zero) |
146 ((unsigned&)m[1][0]^(unsigned&)zero) |
147 ((unsigned&)m[1][1]^(unsigned&)one) |
148 ((unsigned&)m[1][2]^(unsigned&)zero) |
149 ((unsigned&)m[1][3]^(unsigned&)zero) |
150 ((unsigned&)m[2][0]^(unsigned&)zero) |
151 ((unsigned&)m[2][1]^(unsigned&)zero) |
152 ((unsigned&)m[2][2]^(unsigned&)one) |
153 ((unsigned&)m[2][3]^(unsigned&)zero);
154 return !d;
155}
156
157
158/***********************************************************************************************
159 * RenderObjClass::RenderObjClass -- constructor *
160 * *
161 * INPUT: *
162 * *
163 * OUTPUT: *
164 * *
165 * WARNINGS: *
166 * *
167 * HISTORY: *
168 * 11/04/1997 GH : Created. *
169 *=============================================================================================*/
172 Transform(1),
173 NativeScreenSize(WW3D::Get_Default_Native_Screen_Size()),
174 Scene(NULL),
178 ObjectScale(1.0),
179 ObjectColor(0),
180 CachedBoundingSphere(Vector3(0,0,0),1.0f),
181 CachedBoundingBox(Vector3(0,0,0),Vector3(1,1,1)),
183{
184}
185
186/***********************************************************************************************
187 * RenderObjClass::RenderObjClass -- copy constructor *
188 * *
189 * INPUT: *
190 * *
191 * OUTPUT: *
192 * *
193 * WARNINGS: *
194 * *
195 * HISTORY: *
196 * 11/5/97 GTH : Created. *
197 * 1/28/98 EHC : Created. *
198 *=============================================================================================*/
200 Bits(src.Bits),
201 Transform(src.Transform),
203 Scene(NULL),
207 ObjectScale(1.0),
208 ObjectColor(0),
212{
213 // Even though we're copying an object which might be in a scene
214 // this copy won't be so I'm clearing the scene pointer, same logic
215 // follows for things like the Container pointer.
216}
217
218
219/***********************************************************************************************
220 * RenderObjClass -- assignment operator *
221 * *
222 * INPUT: *
223 * *
224 * OUTPUT: *
225 * *
226 * WARNINGS: *
227 * *
228 * HISTORY: *
229 * 11/5/97 GTH : Created. *
230 * 2/25/99 GTH : Created. *
231 *=============================================================================================*/
233{
234 // don't do anything if we're assigning this to this
235 if (this != &that) {
236 Set_Hidden(that.Is_Hidden());
242 }
243 return *this;
244}
245
246
247/***********************************************************************************************
248 * RenderObjClass::Calculate_Texture_Reduction_Factor -- calculate texture reduction factor. *
249 * *
250 * INPUT: *
251 * *
252 * OUTPUT: *
253 * *
254 * WARNINGS: *
255 * *
256 * HISTORY: *
257 * 04/08/99 NH : Created. *
258 *=============================================================================================*/
259/*
260float RenderObjClass::Calculate_Texture_Reduction_Factor(float norm_screensize)
261{
262 // NOTE: The texture reduction factor represents the number of powers of two that the texture
263 // must be reduced by in both dimensions. The reason that such an inherently integral quantity
264 // is represented as a float is for the texture reduction algorithms to incorporate hysteresis
265 // properly.
266 float reduction = sqrt(Get_Native_Screen_Size() / norm_screensize);
267 reduction = MAX(1.0f, reduction);
268
269 // We want to calculate the log base 2. Since the standard libraries have no log-base-2
270 // function, we use the following: log-base-2(x) = log(x)/log(2) where log is the natural
271 // logarithm (which does exist in the stadard libraries).
272 // We precalculare 1/log(2) as 1.442695f.
273 return log(reduction) * 1.442695f;
274}
275*/
276
277/***********************************************************************************************
278 * RenderObjClass::Set_Texture_Reduction_Factor -- set texture reduction factor. *
279 * *
280 * INPUT: *
281 * *
282 * OUTPUT: *
283 * *
284 * WARNINGS: *
285 * *
286 * HISTORY: *
287 * 04/08/99 NH : Created. *
288 *=============================================================================================*/
289/*
290void RenderObjClass::Set_Texture_Reduction_Factor(float trf)
291{
292 WWASSERT(0); // Texture reduction system is broken! Don't call!
293 MaterialInfoClass *minfo = Get_Material_Info();
294 if (minfo) {
295 minfo->Set_Texture_Reduction_Factor(trf);
296 minfo->Release_Ref();
297 } else {
298 int num_obj = Get_Num_Sub_Objects();
299 RenderObjClass *sub_obj;
300
301 for (int i = 0; i < num_obj; i++) {
302 sub_obj = Get_Sub_Object(i);
303 if (sub_obj) {
304 sub_obj->Set_Texture_Reduction_Factor(trf);
305 sub_obj->Release_Ref();
306 }
307 }
308 }
309}
310*/
311
312/***********************************************************************************************
313 * RenderObjClass::Get_Screen_Size -- get normalized area of object. *
314 * *
315 * INPUT: *
316 * *
317 * OUTPUT: *
318 * *
319 * WARNINGS: *
320 * *
321 * HISTORY: *
322 * 3/12/99 NH : Created. *
323 *=============================================================================================*/
325{
326 // Currently this works by projecting the bounding sphere to the screen
327 // (as if the object was at the center) - in future this may be made more
328 // accurate (perhaps by using the object-space bounding-box)
329 Vector3 cam = camera.Get_Position();
330
331 ViewportClass viewport = camera.Get_Viewport();
332 Vector2 vpr_min, vpr_max;
333 camera.Get_View_Plane(vpr_min, vpr_max);
334 float width_factor = viewport.Width() / (vpr_max.X - vpr_min.X);
335 float height_factor = viewport.Height() / (vpr_max.Y - vpr_min.Y);
336
337 const SphereClass & sphere = Get_Bounding_Sphere();
338 float dist = (sphere.Center - cam).Length();
339 float radius = 0.0f;
340 if (dist) {
341 radius = sphere.Radius / dist;
342 }
343
344 // Return area in normalized units.
345 return WWMATH_PI * radius * radius * width_factor * height_factor;
346}
347
348
349/***********************************************************************************************
350 * RenderObjClass::Get_Scene -- returns the (add_ref'd) scene pointer *
351 * *
352 * INPUT: *
353 * *
354 * OUTPUT: *
355 * *
356 * WARNINGS: *
357 * *
358 * HISTORY: *
359 * 3/4/99 GTH : Created. *
360 *=============================================================================================*/
362{
363 if (Scene != NULL) {
364 Scene->Add_Ref();
365 }
366 return Scene;
367}
368
369
370/***********************************************************************************************
371 * RenderObjClass::Set_Container -- sets the container pointer *
372 * *
373 * INPUT: *
374 * *
375 * OUTPUT: *
376 * *
377 * WARNINGS: *
378 * *
379 * HISTORY: *
380 * 3/4/99 GTH : Created. *
381 *=============================================================================================*/
383{
384 // Either we arent currently in a container or we are clearing our container, otherwise
385 // Houston, there is a problem!
386 WWASSERT((con == NULL) || (Container == NULL));
387 Container = con;
388}
389
390#ifdef GET_CONTAINER_INLINE
391// nothing
392#else
393/***********************************************************************************************
394 * RenderObjClass::Get_Container -- returns the container pointer *
395 * *
396 * INPUT: *
397 * *
398 * OUTPUT: *
399 * *
400 * WARNINGS: *
401 * *
402 * HISTORY: *
403 * 3/4/99 GTH : Created. *
404 *=============================================================================================*/
406{
407 return Container;
408}
409#endif
410
411/***********************************************************************************************
412 * RenderObjClass::Set_Transform -- set the transform for this object *
413 * *
414 * INPUT: *
415 * *
416 * OUTPUT: *
417 * *
418 * WARNINGS: *
419 * *
420 * HISTORY: *
421 * 2/25/99 GTH : Created. *
422 *=============================================================================================*/
424{
425 Transform = m;
426 IsTransformIdentity=Check_Is_Transform_Identity(m);
428}
429
430
431/***********************************************************************************************
432 * RenderObjClass::Set_Position -- Sets the position of this object *
433 * *
434 * INPUT: *
435 * *
436 * OUTPUT: *
437 * *
438 * WARNINGS: *
439 * *
440 * HISTORY: *
441 * 2/25/99 GTH : Created. *
442 * 07/14/2001 SKB : Add Check_Is_Transform_Identity *
443 *=============================================================================================*/
445{
446 Transform.Set_Translation(v);
447 IsTransformIdentity=Check_Is_Transform_Identity(Transform);
449}
450
451
452/***********************************************************************************************
453 * RenderObjClass::Validate_Transform -- If the transform is dirty, this causes it to be re-ca *
454 * *
455 * INPUT: *
456 * *
457 * OUTPUT: *
458 * *
459 * WARNINGS: *
460 * *
461 * HISTORY: *
462 * 6/15/99 GTH : Created. *
463 *=============================================================================================*/
465{
466 /*
467 ** Recurse up the tree to see if any of my parents are saying that their sub-object
468 ** transforms are dirty
469 */
471 bool dirty = false;
472 if (con != NULL)
473 {
474 dirty = con->Are_Sub_Object_Transforms_Dirty();
475
476 while (con->Get_Container() != NULL)
477 {
478 dirty |= con->Are_Sub_Object_Transforms_Dirty();
479 con = con->Get_Container();
480 }
481
482 /*
483 ** If the transforms are dirty, update them
484 */
485 if (dirty)
486 {
488 }
489 }
490 if (dirty)
491 IsTransformIdentity = Check_Is_Transform_Identity(Transform);
492}
493
494/***********************************************************************************************
495 * RenderObjClass::Get_Position -- returns the position of this render object *
496 * *
497 * Similar to Get_Transform but returns only the position. *
498 * *
499 * INPUT: *
500 * *
501 * OUTPUT: *
502 * *
503 * WARNINGS: *
504 * *
505 * HISTORY: *
506 * 2/25/99 GTH : Created. *
507 *=============================================================================================*/
509{
511 return Transform.Get_Translation();
512}
513
514
515/***********************************************************************************************
516 * RenderObjClass::Get_Sub_Object -- returns pointer to first sub-obj with given name *
517 * *
518 * INPUT: *
519 * *
520 * OUTPUT: *
521 * *
522 * WARNINGS: *
523 * *
524 * HISTORY: *
525 * 3/4/99 GTH : Created. *
526 *=============================================================================================*/
527RenderObjClass * RenderObjClass::Get_Sub_Object_By_Name(const char * name, int *index) const
528{
529 int i;
530
531 // first try the un-altered name
532 for (i=0; i<Get_Num_Sub_Objects(); i++) {
533 RenderObjClass * robj = Get_Sub_Object(i);
534 if (robj) {
535 if (stricmp(robj->Get_Name(),name) == 0) {
536 if (index) *index=i;
537 return robj;
538 } else {
539 robj->Release_Ref();
540 }
541 }
542 }
543
544 // check the given name against the "suffix" names of each sub-object
545 for (i=0; i<Get_Num_Sub_Objects(); i++) {
546 RenderObjClass * robj = Get_Sub_Object(i);
547 if (robj) {
548 const char * subobjname = strchr(robj->Get_Name(),'.');
549 if (subobjname == NULL) {
550 subobjname = robj->Get_Name();
551 } else {
552 // skip past the period.
553 subobjname = subobjname+1;
554 }
555
556 if (stricmp(subobjname,name) == 0) {
557 if (index) *index=i;
558 return robj;
559 } else {
560 robj->Release_Ref();
561 }
562 }
563 }
564
565 return NULL;
566}
567
568
569/***********************************************************************************************
570 * RenderObjClass::Add_Sub_Object_To_Bone -- add an object to a named bone *
571 * *
572 * INPUT: *
573 * *
574 * OUTPUT: *
575 * *
576 * WARNINGS: If the bone name is unknown then this function will add the the object to the *
577 * root transform rather than failing. This is due to the fact that GetBoneIndex *
578 * returns the root tranform for unknown bones. *
579 * *
580 * HISTORY: *
581 * 3/4/99 GTH : Created. *
582 *=============================================================================================*/
584{
585 int bindex = Get_Bone_Index(bname);
586 return Add_Sub_Object_To_Bone(subobj,bindex);
587}
588
589
590/***********************************************************************************************
591 * RenderObjClass::Remove_Sub_Objects_From_Bone -- remove all objects from a named bone *
592 * *
593 * INPUT: *
594 * *
595 * OUTPUT: *
596 * *
597 * WARNINGS: *
598 * *
599 * HISTORY: *
600 * 3/1/02 NH : Created. *
601 *=============================================================================================*/
603{
604 int count = Get_Num_Sub_Objects_On_Bone(boneindex);
605 int remove_count = 0;
606 for (int i = count-1; i >= 0; i--) {
607 RenderObjClass *robj = Get_Sub_Object_On_Bone(i, boneindex);
608 if ( robj ) {
609 remove_count += Remove_Sub_Object(robj);
610 robj->Release_Ref();
611 }
612 }
613 return remove_count;
614}
615
616
617/***********************************************************************************************
618 * RenderObjClass::Remove_Sub_Objects_From_Bone -- remove all objects from a named bone *
619 * *
620 * INPUT: *
621 * *
622 * OUTPUT: *
623 * *
624 * WARNINGS: *
625 * *
626 * HISTORY: *
627 * 3/4/99 NH : Created. *
628 *=============================================================================================*/
633
634
635/***********************************************************************************************
636 * RenderObjClass::Prepare_LOD -- prepare object for predictive and texture LOD processing. *
637 * *
638 * INPUT: *
639 * *
640 * OUTPUT: *
641 * *
642 * HISTORY: *
643 * 3/11/99 NH : Created. *
644 *=============================================================================================*/
646{
647 // Since most RenderObjClass derivatives are not LOD-capable, the default
648 // implementation just sets the texture reduction factor and doesn't do any
649 // predictive LOD preparation (except for adding the objects' cost to the
650 // total static (nonoptimizeable) cost).
651
652 // Find the maximum screen dimension of the object in pixels
653// float norm_area = Get_Screen_Size(camera);
654
655 // Find and set texture reduction factor
656 // Jani: Don't set tex reduction, it's broken!
657// Set_Texture_Reduction_Factor(Calculate_Texture_Reduction_Factor(norm_area));
658
659 // Since we are not adding this object to the predictive LOD optimizer,
660 // at least add its cost in.
662}
663
664
665/***********************************************************************************************
666 * RenderObjClass::Get_Cost -- get object rendering cost for predictive LOD processing. *
667 * *
668 * INPUT: *
669 * *
670 * OUTPUT: *
671 * *
672 * HISTORY: *
673 * 3/11/99 NH : Created. *
674 *=============================================================================================*/
676{
677 int polycount = Get_Num_Polys();
678 // If polycount is zero set Cost to a small nonzero amount to avoid divisions by zero.
679 float cost = (polycount != 0)? polycount : 0.000001f;
680 return cost;
681}
682
683
684/***********************************************************************************************
685 * RenderObjClass::Calculate_Cost_Value_Arrays -- calc arrays for predictive LOD processing. *
686 * *
687 * INPUT: *
688 * *
689 * OUTPUT: *
690 * *
691 * WARNING: This member function assumes that the arrays passed are large enough (# LODs for *
692 * the cost array and # LODs + 1 for the value array) to contain the desired data. *
693 * *
694 * NOTE: This member function is usually only called internally inside LOD objects for *
695 * initialization purposes, or externally by specialized LOD objects like the G *
696 * predictive LOD PIP proxy. *
697 * *
698 * NOTE: The screen area used is in normalized units. *
699 * *
700 * HISTORY: *
701 * 3/11/99 NH : Created. *
702 *=============================================================================================*/
703int RenderObjClass::Calculate_Cost_Value_Arrays(float screen_area, float *values, float *costs) const
704{
705 values[0] = AT_MIN_LOD;
706 values[1] = AT_MAX_LOD;
707 costs[0] = Get_Cost();
708
709 return 0;
710}
711
712
713/***********************************************************************************************
714 * RenderObjClass::Update_Sub_Object_Bits -- updates our bits according to our sub-objects *
715 * *
716 * This should be called by any object that contains other objects whenever a sub object is *
717 * added or removed. It updates the status of the attribute bits which are supposed to be *
718 * the union of all of the sub-objects attributes. (I.e. if one of our sub-objects is *
719 * translucent, then we should be marked as translucent). *
720 * *
721 * INPUT: *
722 * *
723 * OUTPUT: *
724 * *
725 * WARNINGS: *
726 * *
727 * HISTORY: *
728 * 2/25/99 GTH : Created. *
729 *=============================================================================================*/
731{
732 // this doesn't do anything for non-composite objects
733 if (Get_Num_Sub_Objects() == 0) return;
734
735 // go through all of our sub-objects
736 int coltype = 0;
737 int istrans = 0;
738 int isalpha = 0;
739 int isadditive = 0;
740
741 for (int ni = 0; ni < Get_Num_Sub_Objects(); ni++) {
742 RenderObjClass * robj = Get_Sub_Object(ni);
743 coltype |= robj->Get_Collision_Type();
744 istrans |= robj->Is_Translucent();
745 isalpha |= robj->Is_Alpha();
746 isadditive |= robj->Is_Additive();
747 robj->Release_Ref();
748 }
749
750 Set_Collision_Type(coltype);
751 Set_Translucent(istrans);
752 Set_Alpha(isalpha);
753 Set_Additive(isadditive);
754
755 // if we are a sub-object, tell our container to do this
756 if (Container) {
757 Container->Update_Sub_Object_Bits();
758 }
759}
760
761
762/***********************************************************************************************
763 * RenderObjClass::Update_Sub_Object_Transforms -- re-evaluate the transforms my sub-objects *
764 * *
765 * The default implementation is empty, derived classes which have sub-objects should *
766 * implement it to update the transforms of their sub-objects *
767 * *
768 * INPUT: *
769 * *
770 * OUTPUT: *
771 * *
772 * WARNINGS: *
773 * *
774 * HISTORY: *
775 * 2/25/99 GTH : Created. *
776 *=============================================================================================*/
780
781
782/***********************************************************************************************
783 * RenderObjClass::Add -- Generic add for render objects *
784 * *
785 * INPUT: *
786 * *
787 * OUTPUT: *
788 * *
789 * WARNINGS: *
790 * *
791 * HISTORY: *
792 * 11/04/1997 GH : Created. *
793 * 2/25/99 GTH : Moved to the base RenderObjClass *
794 *=============================================================================================*/
796{
797 WWASSERT(scene);
799 Scene = scene;
800 Scene->Add_Render_Object(this);
801}
802
803/***********************************************************************************************
804 * RenderObjClass::Remove -- Generic Remove for Render Objects *
805 * *
806 * INPUT: *
807 * *
808 * OUTPUT: *
809 * *
810 * WARNINGS: *
811 * *
812 * HISTORY: *
813 * 11/04/1997 GH : Created. *
814 * 2/25/99 GTH : moved to the base RenderObjClass *
815 *=============================================================================================*/
817{
818 // All render objects have their scene pointers set. To check if this is a "top level"
819 // object, (i.e. directly in the scene) you see if its Container pointer is NULL.
820#if 1
821 if (Container == NULL) {
822 if (Scene != NULL) {
823 Scene->Remove_Render_Object(this);
824 return;
825 }
826 } else {
827 Container->Remove_Sub_Object(this);
828 return;
829 }
830#else
831 if (!Scene) return;
832 Scene->Remove_Render_Object(this);
833 Scene = NULL;
834#endif
835}
836
837
838/***********************************************************************************************
839 * RenderObjClass::Notify_Added -- notifies the object that it is in a scene *
840 * *
841 * This function will be called whenever an object is directly or indirectly added to a scene *
842 * An example of "indirect" addition would be if you were added as a sub-object to an HModel *
843 * that was already in a scene. *
844 * *
845 * Override this function if you want to register your object for per-frame-updating or *
846 * as a VertexProcessor. (See the Register method of SceneClass, ParticleBufferClass, etc) *
847 * *
848 * Container objects must forward this notification to their sub objects. *
849 * *
850 * INPUT: *
851 * *
852 * OUTPUT: *
853 * *
854 * WARNINGS: *
855 * Due to implementation details of some derived scenes, the SceneClass calls this function. *
856 * Please dont move the call to this to RenderObjClass::Add *
857 * Derived classes should also call the base class to ensure that the scene pointer is set *
858 * *
859 * HISTORY: *
860 * 2/25/99 GTH : Created. *
861 *=============================================================================================*/
863{
864 Scene = scene;
865}
866
867
868/***********************************************************************************************
869 * RenderObjClass::Notify_Removed -- notifies an object that it has been removed *
870 * *
871 * Works similar to the Notify_Added function. You can override and Unregister yourself from *
872 * any scene based special processing. Container objects must recurse to their sub objects. *
873 * *
874 * INPUT: *
875 * *
876 * OUTPUT: *
877 * *
878 * WARNINGS: *
879 * Derived classes should also call the base class to ensure that the scene pointer is cleared *
880 * *
881 * HISTORY: *
882 * 2/25/99 GTH : Created. *
883 *=============================================================================================*/
888
889
890/***********************************************************************************************
891 * RenderObjClass::Update_Cached_Bounding_Volumes -- default collision sphere. *
892 * *
893 * INPUT: *
894 * *
895 * OUTPUT: *
896 * *
897 * WARNINGS: *
898 * *
899 * HISTORY: *
900 * 11/7/97 GTH : Created. *
901 *=============================================================================================*/
917
918
919/***********************************************************************************************
920 * RenderObjClass::Get_Obj_Space_Bounding_Sphere -- default collision sphere. *
921 * *
922 * INPUT: *
923 * *
924 * OUTPUT: *
925 * *
926 * WARNINGS: *
927 * *
928 * HISTORY: *
929 * 28/8/97 NH : Created. *
930 * 2/25/99 GTH : Moved into RenderObjClass *
931 *=============================================================================================*/
933{
934 sphere.Center.Set(0,0,0);
935 sphere.Radius = 1.0f;
936}
937
938
939/***********************************************************************************************
940 * RenderObjClass::Get_Obj_Space_Bounding_Box -- default collision box. *
941 * *
942 * INPUT: *
943 * *
944 * OUTPUT: *
945 * *
946 * WARNINGS: *
947 * *
948 * HISTORY: *
949 * 28/8/97 NH : Created. *
950 * 2/25/99 GTH : Moved into RenderObjClass *
951 *=============================================================================================*/
953{
954 box.Center.Set(0,0,0);
955 box.Extent.Set(0,0,0);
956}
957
958/***********************************************************************************************
959 * RenderObjClass::Intersect - Returns true if specified intersection object *
960 * intersects this renderobject *
961 * *
962 * *
963 * *
964 * *
965 * INPUT: A properly configured Intersection object specifying ray direction & vector *
966 * *
967 * OUTPUT: *
968 * *
969 * HISTORY: *
970 * 2/25/99 GTH : Moved into RenderObjClass *
971 *=============================================================================================*/
973{
974
975 // do the quick sphere test just to make sure it is worth the more expensive intersection test
976 if (Intersect_Sphere_Quick(Intersection, Final_Result)) {
977
978 CastResultStruct castresult;
979 LineSegClass lineseg;
980
981 Vector3 end = *Intersection->RayLocation + *Intersection->RayDirection * Intersection->MaxDistance;
982 lineseg.Set(* Intersection->RayLocation, end);
983
984 RayCollisionTestClass ray(lineseg, &castresult);
986
987 if (Cast_Ray(ray)) {
988 lineseg.Compute_Point(ray.Result->Fraction,&(Final_Result->Intersection));
989 Final_Result->Intersects = true;
991 if (Intersection->IntersectionNormal)
992 * Intersection->IntersectionNormal = castresult.Normal;
993 Final_Result->IntersectedRenderObject = this;
994 Final_Result->ModelMatrix = Transform;
995 return true;
996 }
997 }
998 Final_Result->Intersects = false;
999 return false;
1000}
1001
1002
1003/***********************************************************************************************
1004 * RenderObjClass::Intersect_Sphere -- tests for intersection with the bounding sphere *
1005 * *
1006 * INPUT: *
1007 * *
1008 * OUTPUT: *
1009 * *
1010 * WARNINGS: *
1011 * *
1012 * HISTORY: *
1013 * 2/25/99 GTH : Created. *
1014 *=============================================================================================*/
1016{
1018 return Intersection->Intersect_Sphere(sphere, Final_Result);
1019}
1020
1021
1022/***********************************************************************************************
1023 * RenderObjClass::Intersect_Sphere_Quick -- tests for intersection with the bounding sphere *
1024 * *
1025 * INPUT: *
1026 * *
1027 * OUTPUT: *
1028 * *
1029 * WARNINGS: *
1030 * *
1031 * HISTORY: *
1032 * 2/25/99 GTH : Created. *
1033 *=============================================================================================*/
1035{
1037 return Intersection->Intersect_Sphere_Quick(sphere, Final_Result);
1038}
1039
1040/***********************************************************************************************
1041 * RenderObjClass::Build_Dependency_List -- Generates a list of files this obj depends on. *
1042 * *
1043 * INPUT: *
1044 * *
1045 * OUTPUT: *
1046 * *
1047 * WARNINGS: *
1048 * *
1049 * HISTORY: *
1050 * 3/18/99 PDS : Created. *
1051 *=============================================================================================*/
1053{
1054 if (recursive)
1055 {
1056 // Loop through all this object's subobj's
1057 int subobj_count = Get_Num_Sub_Objects ();
1058 for (int index = 0; index < subobj_count; index ++) {
1059
1060 // Ask this subobj to add all of its file dependencies to the list
1061 RenderObjClass *psub_obj = Get_Sub_Object (index);
1062 if (psub_obj != NULL) {
1063 psub_obj->Build_Dependency_List (file_list);
1064 psub_obj->Release_Ref ();
1065 }
1066 }
1067 }
1068
1069 // Now add all of this object's dependencies to the list
1070 Add_Dependencies_To_List (file_list);
1071
1072 // Return the true/false result code
1073 return (file_list.Count () > 0);
1074}
1075
1076
1077/***********************************************************************************************
1078 * RenderObjClass::Build_Texture_List -- Builds a list of texture files this obj depends on. *
1079 * *
1080 * INPUT: *
1081 * *
1082 * OUTPUT: *
1083 * *
1084 * WARNINGS: *
1085 * *
1086 * HISTORY: *
1087 * 3/18/99 PDS : Created. *
1088 *=============================================================================================*/
1090(
1091 DynamicVectorClass<StringClass> & texture_file_list,
1092 bool recursive
1093)
1094{
1095 if (recursive) {
1096
1097 //
1098 // Loop through all this object's subobj's
1099 //
1100 int subobj_count = Get_Num_Sub_Objects ();
1101 for (int index = 0; index < subobj_count; index ++) {
1102
1103 //
1104 // Ask this subobj to add all of its texture file dependencies to the list
1105 //
1106 RenderObjClass *sub_obj = Get_Sub_Object (index);
1107 if (sub_obj != NULL) {
1108 sub_obj->Build_Texture_List (texture_file_list);
1109 sub_obj->Release_Ref ();
1110 }
1111 }
1112 }
1113
1114 //
1115 // Now add all of this object's texture dependencies to the list
1116 //
1117 Add_Dependencies_To_List (texture_file_list, true);
1118
1119 // Return the true/false result code
1120 return (texture_file_list.Count () > 0);
1121}
1122
1123/***********************************************************************************************
1124 * RenderObjClass::Add_Dependencies_To_List -- Add dependent files to the list. *
1125 * *
1126 * INPUT: *
1127 * *
1128 * OUTPUT: *
1129 * *
1130 * WARNINGS: *
1131 * *
1132 * HISTORY: *
1133 * 3/18/99 PDS : Created. *
1134 *=============================================================================================*/
1136(
1138 bool textures_only
1139)
1140{
1141 //
1142 // Should we add W3D files to the list?
1143 //
1144 if (textures_only == false) {
1145
1146 //
1147 // Main W3D file
1148 //
1149 const char *model_name = Get_Name ();
1150 file_list.Add (::Filename_From_Asset_Name (model_name));
1151
1152 //
1153 // External hierarchy file
1154 //
1155 const HTreeClass *phtree = Get_HTree ();
1156 if (phtree != NULL) {
1157 const char *htree_name = phtree->Get_Name ();
1158 if (::lstrcmpi (htree_name, model_name) != 0) {
1159
1160 //
1161 // Add this file to the list
1162 //
1163 file_list.Add (::Filename_From_Asset_Name (htree_name));
1164 }
1165 }
1166
1167 //
1168 // Original W3D file (if an aggregate)
1169 //
1170 const char *base_model_name = Get_Base_Model_Name ();
1171 if (base_model_name != NULL) {
1172
1173 //
1174 // Add this file to the list
1175 //
1176 file_list.Add (::Filename_From_Asset_Name (base_model_name));
1177 }
1178 }
1179
1180 return;
1181}
1182
1183
1184
1185/****************************************************************************************
1186
1187
1188 RenderObjClass - Persistant object support.
1189
1190 NOTE: For now, the render obj PersistFactory is going to cheat by simply storing
1191 the name of the render object that was saved. At load time, it will ask the
1192 asset manager for that object again. If the asset manager fails to re-create the
1193 object,
1194
1195
1196****************************************************************************************/
1197
1199{
1200 virtual uint32 Chunk_ID(void) const;
1201 virtual PersistClass * Load(ChunkLoadClass & cload) const;
1202 virtual void Save(ChunkSaveClass & csave,PersistClass * obj) const;
1203
1204 enum
1205 {
1206 RENDOBJFACTORY_CHUNKID_VARIABLES = 0x00555040,
1207 RENDOBJFACTORY_VARIABLE_OBJPOINTER = 0x00,
1208 RENDOBJFACTORY_VARIABLE_NAME,
1209 RENDOBJFACTORY_VARIABLE_TRANSFORM
1210 };
1211};
1212
1213static RenderObjPersistFactoryClass _RenderObjPersistFactory;
1214
1215uint32 RenderObjPersistFactoryClass::Chunk_ID(void) const
1216{
1218}
1219
1220PersistClass * RenderObjPersistFactoryClass::Load(ChunkLoadClass & cload) const
1221{
1222 RenderObjClass * old_obj = NULL;
1223 Matrix3D tm(1);
1224 char name[64];
1225
1226 while (cload.Open_Chunk()) {
1227 switch (cload.Cur_Chunk_ID()) {
1228
1229 case RENDOBJFACTORY_CHUNKID_VARIABLES:
1230
1231 while (cload.Open_Micro_Chunk()) {
1232 switch(cload.Cur_Micro_Chunk_ID()) {
1233 READ_MICRO_CHUNK(cload,RENDOBJFACTORY_VARIABLE_OBJPOINTER,old_obj);
1234 READ_MICRO_CHUNK(cload,RENDOBJFACTORY_VARIABLE_TRANSFORM,tm);
1235 READ_MICRO_CHUNK_STRING(cload,RENDOBJFACTORY_VARIABLE_NAME,name,sizeof(name));
1236 }
1237 cload.Close_Micro_Chunk();
1238 }
1239 break;
1240
1241 default:
1242 WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__));
1243 break;
1244 };
1245 cload.Close_Chunk();
1246 }
1247
1248 // if the object we saved didn't have a name, replace it with null
1249 if (strlen(name) == 0) {
1250 static int count = 0;
1251 if ( ++count < 10 ) {
1252 WWDEBUG_SAY(("RenderObjPersistFactory attempted to load an un-named render object!\r\n"));
1253 WWDEBUG_SAY(("Replacing it with a NULL render object!\r\n"));
1254 }
1255 strcpy(name,"NULL");
1256 }
1257
1258 RenderObjClass * new_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj(name);
1259
1260 if (new_obj == NULL) {
1261 static int count = 0;
1262 if ( ++count < 10 ) {
1263 WWDEBUG_SAY(("RenderObjPersistFactory failed to create object: %s!!\r\n",name));
1264 WWDEBUG_SAY(("Either the asset for this object is gone or you tried to save a procedural object.\r\n"));
1265 WWDEBUG_SAY(("Replacing it with a NULL render object!\r\n"));
1266 }
1267 strcpy(name,"NULL");
1269 }
1270
1271 WWASSERT(new_obj != NULL);
1272 if (new_obj) {
1273 new_obj->Set_Transform(tm);
1274 }
1275
1277 return new_obj;
1278}
1279
1280void RenderObjPersistFactoryClass::Save(ChunkSaveClass & csave,PersistClass * obj) const
1281{
1282 RenderObjClass * robj = (RenderObjClass *)obj;
1283 const char * name = robj->Get_Name();
1284 Matrix3D tm = robj->Get_Transform();
1285
1286 csave.Begin_Chunk(RENDOBJFACTORY_CHUNKID_VARIABLES);
1287 WRITE_MICRO_CHUNK(csave,RENDOBJFACTORY_VARIABLE_OBJPOINTER,robj);
1288 WRITE_MICRO_CHUNK_STRING(csave,RENDOBJFACTORY_VARIABLE_NAME,name);
1289 WRITE_MICRO_CHUNK(csave,RENDOBJFACTORY_VARIABLE_TRANSFORM,tm);
1290 csave.End_Chunk();
1291}
1292
1293
1294/*
1295** RenderObj save-load.
1296*/
1298{
1299 return _RenderObjPersistFactory;
1300}
1301
1303{
1304 // This should never hit with the persist factory we're using...
1305 // Yes this looks like a design flaw but the way we're saving render objects is
1306 // a "shortcut". We specifically designed this capability into the persistant
1307 // object system so that we could avoid making all render object's save and
1308 // load themselves if possible.
1309 WWASSERT(0);
1310 return true;
1311}
1312
1314{
1315 WWASSERT(0); // this should never hit with the persist factory we're using.
1316 return true;
1317}
1318
1319
#define NULL
Definition BaseType.h:92
#define WWASSERT
unsigned long uint32
Definition bittype.h:46
@ false
Definition bool.h:59
#define WRITE_MICRO_CHUNK(csave, id, var)
Definition chunkio.h:293
#define READ_MICRO_CHUNK_STRING(cload, id, var, size)
Definition chunkio.h:348
#define WRITE_MICRO_CHUNK_STRING(csave, id, var)
Definition chunkio.h:304
#define READ_MICRO_CHUNK(cload, id, var)
Definition chunkio.h:334
#define WWMATH_PI
Definition wwmath.h:56
Vector3 Center
Definition aabox.h:123
Vector3 Extent
Definition aabox.h:124
void Get_View_Plane(Vector2 &set_min, Vector2 &set_max) const
Definition camera.cpp:380
void Get_Viewport(Vector2 &set_min, Vector2 &set_max) const
Definition camera.h:281
bool Close_Micro_Chunk()
Definition chunkio.cpp:585
bool Close_Chunk()
Definition chunkio.cpp:448
uint32 Cur_Chunk_ID()
Definition chunkio.cpp:484
uint32 Cur_Micro_Chunk_ID()
Definition chunkio.cpp:622
bool Open_Chunk()
Definition chunkio.cpp:412
bool Open_Micro_Chunk()
Definition chunkio.cpp:557
bool Begin_Chunk(uint32 id)
Definition chunkio.cpp:108
bool End_Chunk()
Definition chunkio.cpp:148
CastResultStruct * Result
Definition coltest.h:98
int Count(void) const
Definition Vector.H:507
bool Add(T const &object)
Definition Vector.H:671
WWINLINE const char * Get_Name(void) const
Definition htree.h:92
bool Intersect_Sphere(SphereClass &Sphere, IntersectionResultClass *FinalResult)
Definition intersec.h:246
bool Intersect_Sphere_Quick(SphereClass &Sphere, IntersectionResultClass *FinalResult)
Definition intersec.h:228
Vector3 * IntersectionNormal
Definition intersec.h:110
Vector3 * RayLocation
Definition intersec.h:108
Vector3 * RayDirection
Definition intersec.h:109
RenderObjClass * IntersectedRenderObject
Definition intersec.h:74
enum IntersectionResultClass::INTERSECTION_TYPE IntersectionType
void Set(const Vector3 &p0, const Vector3 &p1)
Definition lineseg.h:66
void Compute_Point(float t, Vector3 *set) const
Definition lineseg.h:76
void mulVector3(const Vector3 &in, Vector3 &out) const
Definition matrix3d.h:1650
static void Add_Cost(float cost)
Definition predlod.h:67
WWINLINE void Release_Ref(void) const
Definition refcount.h:146
virtual float Get_Screen_Size(CameraClass &camera)
Definition rendobj.cpp:324
unsigned long Bits
Definition rendobj.h:548
virtual int Is_Hidden(void) const
Definition rendobj.h:471
virtual int Is_Animation_Hidden(void) const
Definition rendobj.h:473
virtual bool Intersect_Sphere_Quick(IntersectionClass *Intersection, IntersectionResultClass *Final_Result)
Definition rendobj.cpp:1034
virtual RenderObjClass * Get_Sub_Object_On_Bone(int index, int boneindex) const
Definition rendobj.h:316
Vector3 Get_Position(void) const
Definition rendobj.cpp:508
virtual void Set_Transform(const Matrix3D &m)
Definition rendobj.cpp:423
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
Definition rendobj.cpp:932
virtual int Get_Num_Sub_Objects_On_Bone(int boneindex) const
Definition rendobj.h:315
virtual int Is_Translucent(void) const
Definition rendobj.h:478
void Validate_Cached_Bounding_Volumes(void) const
Definition rendobj.h:524
RenderObjClass(void)
Definition rendobj.cpp:170
virtual void Set_Translucent(int onoff)
Definition rendobj.h:479
virtual int Is_Additive(void) const
Definition rendobj.h:482
virtual void Set_Position(const Vector3 &v)
Definition rendobj.cpp:444
float NativeScreenSize
Definition rendobj.h:554
virtual const SphereClass & Get_Bounding_Sphere(void) const
Definition rendobj.h:567
AABoxClass CachedBoundingBox
Definition rendobj.h:553
virtual bool Build_Dependency_List(DynamicVectorClass< StringClass > &file_list, bool recursive=true)
Definition rendobj.cpp:1052
virtual void Notify_Added(SceneClass *scene)
Definition rendobj.cpp:862
virtual int Remove_Sub_Objects_From_Bone(int boneindex)
Definition rendobj.cpp:602
virtual void Update_Sub_Object_Transforms(void)
Definition rendobj.cpp:777
virtual SceneClass * Get_Scene(void)
Definition rendobj.cpp:361
RenderObjClass * Container
Definition rendobj.h:558
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
Definition rendobj.cpp:952
virtual void Update_Cached_Bounding_Volumes(void) const
Definition rendobj.cpp:902
void Invalidate_Cached_Bounding_Volumes(void) const
Definition rendobj.h:523
unsigned int ObjectColor
Definition rendobj.h:551
virtual void Set_Collision_Type(int type)
Definition rendobj.h:485
virtual float Get_Cost(void) const
Definition rendobj.cpp:675
virtual bool Intersect_Sphere(IntersectionClass *Intersection, IntersectionResultClass *Final_Result)
Definition rendobj.cpp:1015
virtual void Update_Sub_Object_Bits(void)
Definition rendobj.cpp:730
RenderObjClass & operator=(const RenderObjClass &)
Definition rendobj.cpp:232
SceneClass * Scene
Definition rendobj.h:557
virtual const HTreeClass * Get_HTree(void) const
Definition rendobj.h:363
virtual const char * Get_Base_Model_Name(void) const
Definition rendobj.h:252
virtual int Add_Sub_Object_To_Bone(RenderObjClass *subobj, int bone_index)
Definition rendobj.h:319
virtual const PersistFactoryClass & Get_Factory(void) const
Definition rendobj.cpp:1297
static const float AT_MAX_LOD
Definition rendobj.h:405
virtual void Set_Hidden(int onoff)
Definition rendobj.h:472
RenderHookClass * RenderHook
Definition rendobj.h:561
virtual void Set_Force_Visible(int onoff)
Definition rendobj.h:476
virtual void Set_Alpha(int onoff)
Definition rendobj.h:481
bool IsTransformIdentity
Definition rendobj.h:555
bool Are_Sub_Object_Transforms_Dirty(void)
Definition rendobj.h:495
virtual bool Save(ChunkSaveClass &csave)
Definition rendobj.cpp:1302
virtual void Add_Dependencies_To_List(DynamicVectorClass< StringClass > &file_list, bool textures_only=false)
Definition rendobj.cpp:1136
virtual void Notify_Removed(SceneClass *scene)
Definition rendobj.cpp:884
virtual void Set_Container(RenderObjClass *con)
Definition rendobj.cpp:382
virtual const char * Get_Name(void) const
Definition rendobj.h:250
const Matrix3D & Get_Transform(void) const
Definition rendobj.h:617
virtual void Validate_Transform(void) const
Definition rendobj.cpp:464
virtual int Calculate_Cost_Value_Arrays(float screen_area, float *values, float *costs) const
Definition rendobj.cpp:703
virtual float Get_Native_Screen_Size(void) const
Definition rendobj.h:488
virtual bool Load(ChunkLoadClass &cload)
Definition rendobj.cpp:1313
virtual int Get_Num_Sub_Objects(void) const
Definition rendobj.h:309
virtual bool Build_Texture_List(DynamicVectorClass< StringClass > &texture_file_list, bool recursive=true)
Definition rendobj.cpp:1090
virtual int Is_Alpha(void) const
Definition rendobj.h:480
virtual RenderObjClass * Get_Sub_Object_By_Name(const char *name, int *index=NULL) const
Definition rendobj.cpp:527
virtual void Remove(void)
Definition rendobj.cpp:816
virtual bool Cast_Ray(RayCollisionTestClass &raytest)
Definition rendobj.h:376
friend class SceneClass
Definition rendobj.h:563
virtual void Prepare_LOD(CameraClass &camera)
Definition rendobj.cpp:645
virtual int Is_Force_Visible(void) const
Definition rendobj.h:475
RenderObjClass * Get_Container(void) const
Definition rendobj.h:291
Matrix3D Transform
Definition rendobj.h:549
virtual int Get_Bone_Index(const char *bonename)
Definition rendobj.h:354
virtual void Set_Native_Screen_Size(float screensize)
Definition rendobj.h:489
virtual RenderObjClass * Get_Sub_Object(int index) const
Definition rendobj.h:310
float ObjectScale
Definition rendobj.h:550
virtual int Get_Collision_Type(void) const
Definition rendobj.h:484
virtual void Add(SceneClass *scene)
Definition rendobj.cpp:795
virtual int Get_Num_Polys(void) const
Definition rendobj.h:254
void * User_Data
Definition rendobj.h:559
virtual bool Intersect(IntersectionClass *Intersection, IntersectionResultClass *Final_Result)
Definition rendobj.cpp:972
virtual void Set_Animation_Hidden(int onoff)
Definition rendobj.h:474
virtual int Remove_Sub_Object(RenderObjClass *robj)
Definition rendobj.h:312
virtual void Set_Additive(int onoff)
Definition rendobj.h:483
SphereClass CachedBoundingSphere
Definition rendobj.h:552
static const float AT_MIN_LOD
Definition rendobj.h:404
static void Register_Pointer(void *old_pointer, void *new_pointer)
Definition saveload.cpp:210
float Radius
Definition sphere.h:91
Vector3 Center
Definition sphere.h:90
TCHAR * Get_Buffer(int new_length)
Definition wwstring.h:549
float Y
Definition vector2.h:79
float X
Definition vector2.h:74
WWINLINE void Set(float x, float y, float z)
Definition vector3.h:103
float Height(void) const
Definition camera.h:78
float Width(void) const
Definition camera.h:77
virtual RenderObjClass * Create_Render_Obj(const char *name)
Definition assetmgr.cpp:799
static WW3DAssetManager * Get_Instance(void)
Definition assetmgr.h:205
Definition ww3d.h:78
@ COLL_TYPE_ALL
Definition coltype.h:75
StringClass Filename_From_Asset_Name(const char *asset_name)
Definition rendobj.cpp:109
Vector3 Normal
Definition castres.h:66
@ WW3D_PERSIST_CHUNKID_RENDEROBJ
Definition ww3dids.h:72
#define WWDEBUG_SAY(x)
Definition wwdebug.h:114