Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
shattersystem.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 : WWPhys *
24 * *
25 * $Archive:: /Commando/Code/ww3d2/shattersystem.h $*
26 * *
27 * Original Author:: Greg Hjelstrom *
28 * *
29 * $Author:: Greg_h $*
30 * *
31 * $Modtime:: 1/08/01 10:04a $*
32 * *
33 * $Revision:: 1 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
38
39#if defined(_MSC_VER)
40#pragma once
41#endif
42
43#ifndef SHATTERSYSTEM_H
44#define SHATTERSYSTEM_H
45
46#include "always.h"
47
48
49class MeshClass;
50class PhysicsSceneClass;
51class RenderObjClass;
52class Vector3;
53class Matrix3D;
55
56
63{
64public:
65
66 /*
67 ** Init and Shutdown, these are called from the main physics system init and
68 ** shutdown. The BSP shatter planes are loaded up and initialized in Init
69 ** and released in Shutdown.
70 */
71 static void Init(void);
72 static void Shutdown(void);
73
74 /*
75 ** Pass in the mesh you want shattered and the scene that you want
76 ** the shards to be placed in.
77 */
78 static void Shatter_Mesh(MeshClass * mesh,const Vector3 & point,const Vector3 & velocity);
79
80 /*
81 ** Use these methods to get access to the resultant mesh fragments
82 ** Get_Fragment_Count - returns the number of meshes created
83 ** Get_Fragment - returns a pointer (ref-counted!) to the 'n'th mesh
84 ** Relese_Fragments - call this when you are done, it causes the ShatterSystem
85 ** to release its references to the fragments.
86 */
87 static int Get_Fragment_Count(void);
88 static RenderObjClass * Get_Fragment(int fragment_index);
89 static RenderObjClass * Peek_Fragment(int fragment_index);
90 static void Release_Fragments(void);
91
92protected:
93
94 static void Reset_Clip_Pools(void);
95 static void Process_Clip_Pools(const Matrix3D &Mshatter_to_mesh,MeshClass * mesh,MeshMtlParamsClass & mtl_params);
96
97
98};
99
100
101#endif
102
103
static void Reset_Clip_Pools(void)
static void Shutdown(void)
static RenderObjClass * Get_Fragment(int fragment_index)
static RenderObjClass * Peek_Fragment(int fragment_index)
static void Shatter_Mesh(MeshClass *mesh, const Vector3 &point, const Vector3 &velocity)
static void Release_Fragments(void)
static void Process_Clip_Pools(const Matrix3D &Mshatter_to_mesh, MeshClass *mesh, MeshMtlParamsClass &mtl_params)
static void Init(void)
static int Get_Fragment_Count(void)