4 Scalable Building Simulator - Floor Class
5 The Skyscraper Project - Version 1.8 Alpha
6 Copyright (C)20042012 Ryan Thoryk
7 http://www.skyscrapersim.com
8 http://sourceforge.net/projects/skyscraper
9 Contact - ryan@tliquest.net
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 as published by the Free Software Foundation; either version 2
14 of the License, or (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #include "callbutton.h"
31 #include "floorindicator.h"
32 #include "directional.h"
38 Object *object; //SBS object
39 MeshObject *Level; //level mesh
40 MeshObject *Interfloor; //interfloor mesh
41 MeshObject *ColumnFrame; //columnframe mesh
43 int Number; //floor number
44 std::string Name; //floor name
46 std::string FloorType;
47 std::string Description;
48 std::string IndicatorTexture; //elevator indicator texture name
49 float Altitude; //floor altitude
50 float Height; //floor height (not including interfloor height)
51 float InterfloorHeight; //height of interfloor area
52 bool IsEnabled; //is floor enabled?
53 bool IsColumnFrameEnabled; //is columnframe enabled?
54 std::vector<CallButton*> CallButtonArray; //pointer array to call button objects
55 std::vector<FloorIndicator*> FloorIndicatorArray; //pointer array to floor indicator objects
56 std::vector<int> Group; //floor group
61 void SetCameraFloor();
62 WallObject* AddFloor(const char *name, const char *texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, float tw, float th, bool isexternal);
63 WallObject* AddInterfloorFloor(const char *name, const char *texture, float thickness, float x1, float z1, float x2, float z2, float voffset1, float voffset2, float tw, float th);
64 WallObject* AddWall(const char *name, const char *texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th, bool isexternal);
65 WallObject* AddInterfloorWall(const char *name, const char *texture, float thickness, float x1, float z1, float x2, float z2, float height_in1, float height_in2, float voffset1, float voffset2, float tw, float th);
66 void Enabled(bool value);
68 Object* AddCallButtons(std::vector<int> &elevators, const char *BackTexture, const char *UpButtonTexture, const char *UpButtonTexture_Lit, const char *DownButtonTexture, const char *DownButtonTexture_Lit, float CenterX, float CenterZ, float voffset, const char *direction, float BackWidth, float BackHeight, bool ShowBack, float tw, float th);
69 void Cut(const Ogre::Vector3 &start, const Ogre::Vector3 &end, bool cutwalls, bool cutfloors, bool fast, int checkwallnumber = 0, const char *checkstring = "");
70 void CutAll(const Ogre::Vector3 &start, const Ogre::Vector3 &end, bool cutwalls, bool cutfloors);
71 void AddGroupFloor(int number);
72 void RemoveGroupFloor(int number);
73 void EnableGroup(bool value);
74 bool IsInGroup(int floor);
75 Object* AddDoor(const char *open_sound, const char *close_sound, bool open_state, const char *texture, float thickness, int direction, float speed, float CenterX, float CenterZ, float width, float height, float voffset, float tw, float th);
76 bool CalculateAltitude();
77 void EnableColumnFrame(bool value);
78 WallObject* ColumnWallBox(const char *name, const char *texture, float x1, float x2, float z1, float z2, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom);
79 WallObject* ColumnWallBox2(const char *name, const char *texture, float CenterX, float CenterZ, float WidthX, float LengthZ, float height_in, float voffset, float tw, float th, bool inside, bool outside, bool top, bool bottom);
80 Object* AddFloorIndicator(int elevator, bool relative, const char *texture_prefix, const char *direction, float CenterX, float CenterZ, float width, float height, float voffset);
81 void UpdateFloorIndicators(int elevator);
82 void UpdateFloorIndicators();
83 void UpdateDirectionalIndicators(int elevator);
84 void UpdateDirectionalIndicators();
85 Object* AddDirectionalIndicator(int elevator, bool relative, bool active_direction, bool single, bool vertical, const char *BackTexture, const char *uptexture, const char *uptexture_lit, const char *downtexture, const char *downtexture_lit, float CenterX, float CenterZ, float voffset, const char *direction, float BackWidth, float BackHeight, bool ShowBack, float tw, float th);
86 void SetDirectionalIndicators(int elevator, bool UpLight, bool DownLight);
88 std::vector<int> GetCallButtons(int elevator);
89 void AddFillerWalls(const char *texture, float thickness, float CenterX, float CenterZ, float width, float height, float voffset, bool direction, float tw, float th);
90 Object* AddSound(const char *name, const char *filename, Ogre::Vector3 position, int volume = 1.0, int speed = 100, float min_distance = 1.0, float max_distance = -1.0, float dir_radiation = 0, Ogre::Vector3 direction = Ogre::Vector3(0, 0, 0));
91 void Report(std::string message);
92 bool ReportError(std::string message);
93 float GetBase(bool relative = false);
94 void OpenDoor(int number);
95 void CloseDoor(int number);
96 bool IsDoorOpen(int number);
97 bool IsDoorMoving(int number);
98 void RemoveCallButton(CallButton *callbutton);
99 void RemoveFloorIndicator(FloorIndicator *indicator);
100 void RemoveDirectionalIndicator(DirectionalIndicator *indicator);
101 void RemoveDoor(Door *door);
102 void RemoveSound(Sound *sound);
103 Object* AddLight(const char *name, int type, Ogre::Vector3 position, Ogre::Vector3 direction, float color_r, float color_g, float color_b, float spec_color_r, float spec_color_g, float spec_color_b, float spot_inner_angle, float spot_outer_angle, float spot_falloff, float att_range, float att_constant, float att_linear, float att_quadratic);
104 Object* AddModel(const char *name, const char *filename, Ogre::Vector3 position, Ogre::Vector3 rotation, float max_render_distance = 0, float scale_multiplier = 1, bool enable_physics = false, float restitution = 0, float friction = 0, float mass = 0);
111 std::vector<Sound*> sounds;
114 std::vector<Door*> DoorArray; //pointer array to door objects
117 std::vector<Light*> lights;
119 //directional indicators
120 std::vector<DirectionalIndicator*> DirIndicatorArray;
123 std::vector<Model*> ModelArray;