Skyscraper 2.0
primitive.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - Model 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
24#ifndef _SBS_PRIMITIVE_H
25#define _SBS_PRIMITIVE_H
26
27namespace SBS {
28
30{
31public:
32
34 int collider_type; //0 for standard, 1 for no collider
35
36 //functions
37 Primitive(Object *parent, const std::string &name);
38 ~Primitive();
39 bool IsEnabled();
40 void Enabled(bool value);
41 bool IsKey();
42 int GetKeyID();
43 void SetKey(int keyid);
44 bool IsPhysical();
45 void Loop();
46 void PickUp();
47 void Drop();
48 bool IsPickedUp();
49 MeshObject* GetMeshObject() { return mesh; }
50 void OnClick(Vector3 &position, bool shift, bool ctrl, bool alt, bool right);
51 bool Attach(const std::string &meshname, const Vector3 &position, const Vector3 &rotation, Real max_render_distance = 0, Real scale_multiplier = 1, bool enable_physics = false, Real restitution= 0, Real friction = 0, Real mass = 0);
52 void SetTexture(const std::string &texture);
53
54private:
55 void RemoveFromParent();
56 void AddToParent();
57
60 bool is_key;
61 int KeyID;
62 bool global;
63};
64
65}
66
67#endif
Vector3 Offset
Definition primitive.h:59
bool always_visible
Definition primitive.h:33
MeshObject * mesh
Definition primitive.h:58
void SetKey(int keyid)
MeshObject * GetMeshObject()
Definition primitive.h:49
Ogre::Vector3 Vector3
Definition globals.h:58
Ogre::Real Real
Definition globals.h:57
#define SBSIMPEXP
Definition globals.h:53