Skyscraper 2.0
utility.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - Utility Object
3 The Skyscraper Project - Version 2.0
4 Copyright (C)2004-2024 Ryan Thoryk
5 https://www.skyscrapersim.net
6 https://sourceforge.net/projects/skyscraper/
7 Contact - ryan@skyscrapersim.net
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22*/
23
24namespace SBS {
25
27{
28public:
29 Utility(Object *parent);
30 ~Utility();
31 Vector2 GetExtents(PolyArray &varray, int coord, bool flip_z = false);
32 void Cut(Wall *wall, Vector3 start, Vector3 end, bool cutwalls, bool cutfloors, int checkwallnumber = 0, bool reset_check = true);
33 void GetDoorwayExtents(MeshObject *mesh, int checknumber, PolyArray &polygon);
34 Vector3 GetPolygonDirection(PolyArray &polygon);
35 Vector2 GetEndPoint(const Vector2 &StartPoint, Real angle, Real distance);
36 Plane ComputePlane(PolyArray &vertices, bool flip_normal = true);
37 void SplitWithPlane(int axis, PolyArray &orig, PolyArray &poly1, PolyArray &poly2, Real value);
38 Vector3 ComputeNormal(PolyArray &vertices, Real &D);
39 void ResetDoorwayWalls();
40 Wall* AddDoorwayWalls(MeshObject* mesh, const std::string &wallname, const std::string &texture, Real tw, Real th);
41
42private:
43
44 //Cut function work polygons
45 PolyArray temppoly, temppoly2, temppoly3, temppoly4, temppoly5, worker;
47
49
50 //doorway data
51 bool wall1a, wall1b, wall2a, wall2b;
52 Vector2 wall_extents_x, wall_extents_z, wall_extents_y;
53};
54
55}
PolyArray newpoly
Definition utility.h:48
PolyArray temppoly
Definition utility.h:45
bool wall1a
Definition utility.h:51
Vector2 wall_extents_x
Definition utility.h:52
PolygonSet newpolys
Definition utility.h:46
Ogre::Vector3 Vector3
Definition globals.h:58
Ogre::Real Real
Definition globals.h:57
Ogre::Plane Plane
Definition globals.h:65
Ogre::Vector2 Vector2
Definition globals.h:59
#define SBSIMPEXP
Definition globals.h:53
std::vector< Vector3 > PolyArray
Definition sbs.h:118
std::vector< PolyArray > PolygonSet
Definition sbs.h:119