Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
composite.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 : WW3D *
24 * *
25 * $Archive:: /Commando/Code/ww3d2/composite.h $*
26 * *
27 * Author:: Greg Hjelstrom *
28 * *
29 * $Modtime:: 11/25/01 12:25p $*
30 * *
31 * $Revision:: 5 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#if defined(_MSC_VER)
39#pragma once
40#endif
41
42#ifndef COMPOSITE_H
43#define COMPOSITE_H
44
45#include "rendobj.h"
46#include "wwstring.h"
47
48/*
49** CompositeRenderObjClass
50** The sole purpose of this class is to encapsulate some of the chores that all
51** "composite" (contain sub objects) render objects have to do. Typically all
52** of the functions are implemented through the existing sub-object interface
53** so there is still no assumption on how you store/organize your sub-objects.
54*/
56{
57public:
58
61 virtual ~CompositeRenderObjClass(void);
63
64 virtual void Restart(void);
65
66 virtual const char * Get_Name(void) const;
67 virtual void Set_Name(const char * name);
68 virtual const char * Get_Base_Model_Name (void) const;
69 virtual void Set_Base_Model_Name (const char *name);
70 virtual int Get_Num_Polys(void) const;
71 virtual void Notify_Added(SceneClass * scene);
72 virtual void Notify_Removed(SceneClass * scene);
73
74 virtual bool Cast_Ray(RayCollisionTestClass & raytest);
75 virtual bool Cast_AABox(AABoxCollisionTestClass & boxtest);
76 virtual bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
77 virtual bool Intersect_AABox(AABoxIntersectionTestClass & boxtest);
78 virtual bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest);
79
80 virtual void Create_Decal(DecalGeneratorClass * generator);
81 virtual void Delete_Decal(uint32 decal_id);
82
83 virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const { sphere = ObjSphere; }
84 virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const { box = ObjBox; }
85 virtual void Update_Obj_Space_Bounding_Volumes(void);
86
87 virtual void Set_User_Data(void *value, bool recursive = false);
88
89protected:
90
91 StringClass Name; // name of the render object
92 StringClass BaseModelName; // name of the original render obj (before aggregation)
93 SphereClass ObjSphere; // object-space bounding sphere
94 AABoxClass ObjBox; // object-space bounding box
95};
96
97
98
99#endif
void const char * value
unsigned long uint32
Definition bittype.h:46
virtual void Set_User_Data(void *value, bool recursive=false)
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
Definition composite.h:83
virtual void Notify_Removed(SceneClass *scene)
virtual ~CompositeRenderObjClass(void)
virtual void Notify_Added(SceneClass *scene)
CompositeRenderObjClass & operator=(const CompositeRenderObjClass &that)
virtual void Create_Decal(DecalGeneratorClass *generator)
virtual int Get_Num_Polys(void) const
virtual const char * Get_Name(void) const
virtual void Delete_Decal(uint32 decal_id)
virtual void Set_Name(const char *name)
virtual bool Cast_AABox(AABoxCollisionTestClass &boxtest)
virtual bool Intersect_AABox(AABoxIntersectionTestClass &boxtest)
virtual void Restart(void)
virtual bool Cast_Ray(RayCollisionTestClass &raytest)
virtual bool Cast_OBBox(OBBoxCollisionTestClass &boxtest)
StringClass BaseModelName
Definition composite.h:92
SphereClass ObjSphere
Definition composite.h:93
virtual const char * Get_Base_Model_Name(void) const
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
Definition composite.h:84
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass &boxtest)
virtual void Set_Base_Model_Name(const char *name)
virtual void Update_Obj_Space_Bounding_Volumes(void)
RenderObjClass(void)
Definition rendobj.cpp:170
friend class SceneClass
Definition rendobj.h:563