Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
aabox.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 : WWMath *
24 * *
25 * $Archive:: /Commando/Code/wwmath/aabox.cpp $*
26 * *
27 * Author:: Greg_h *
28 * *
29 * $Modtime:: 5/08/01 6:33p $*
30 * *
31 * $Revision:: 18 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * AABoxClass::Init_Random -- initializes this box to a random state *
36 * AABoxClass::Contains -- test whether this box contains the given point *
37 * AABoxClass::Contains -- Test whether this box contains the given box *
38 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
39
40#include "aabox.h"
41#include "colmath.h"
42#include "colmathinlines.h"
43#include <float.h>
44
45
46/***********************************************************************************************
47 * AABoxClass::Init_Random -- initializes this box to a random state *
48 * *
49 * INPUT: *
50 * *
51 * OUTPUT: *
52 * *
53 * WARNINGS: *
54 * *
55 * HISTORY: *
56 * 3/17/2000 gth : Created. *
57 *=============================================================================================*/
58void AABoxClass::Init_Random(float min_center,float max_center,float min_extent,float max_extent)
59{
60 Center.X = min_center + WWMath::Random_Float() * (max_center - min_center);
61 Center.Y = min_center + WWMath::Random_Float() * (max_center - min_center);
62 Center.Z = min_center + WWMath::Random_Float() * (max_center - min_center);
63
64 Extent.X = min_extent + WWMath::Random_Float() * (max_extent - min_extent);
65 Extent.Y = min_extent + WWMath::Random_Float() * (max_extent - min_extent);
66 Extent.Z = min_extent + WWMath::Random_Float() * (max_extent - min_extent);
67}
68
69
70void AABoxClass::Transform(const Matrix3D & tm,const AABoxClass & in,AABoxClass * out)
71{
73}
74
76{
77 MinCorner.Set(FLT_MAX,FLT_MAX,FLT_MAX);
78 MaxCorner.Set(-FLT_MAX,-FLT_MAX,-FLT_MAX);
79}
void Transform(const Matrix3D &tm)
Definition aabox.h:185
Vector3 Center
Definition aabox.h:123
Vector3 Extent
Definition aabox.h:124
WWINLINE AABoxClass(void)
Definition aabox.h:87
void Init_Random(float min_center=-1.0f, float max_center=1.0f, float min_extent=0.5f, float max_extent=1.0f)
Definition aabox.cpp:58
void Transform_Center_Extent_AABox(const Vector3 &center, const Vector3 &extent, Vector3 *set_center, Vector3 *set_extent) const
Vector3 MinCorner
Definition aabox.h:164
void Init_Empty(void)
Definition aabox.cpp:75
Vector3 MaxCorner
Definition aabox.h:165
static float Random_Float(void)
Definition wwmath.cpp:78