Skyscraper 2.0
scenenode.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - SceneNode 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_SCENENODE_H
25#define _SBS_SCENENODE_H
26
27namespace SBS {
28
30{
31public:
32
33 SceneNode(Object *parent, std::string name);
34 ~SceneNode();
35 Ogre::SceneNode* GetRawSceneNode() { return node; }
36 void AddChild(SceneNode *scenenode);
37 void RemoveChild(SceneNode *scenenode);
38 void ShowBoundingBox(bool value);
39 void SetPosition(const Vector3 &position, bool relative = false, bool force = false);
40 Vector3 GetPosition(bool relative = false);
41 void SetRotation(const Vector3 &rotation);
42 Vector3 GetRotation();
43 void Update();
44 Quaternion GetOrientation(bool relative = false);
45 void SetOrientation(const Quaternion &q, bool relative = false);
46 void Move(const Vector3 &vector, Real speed = 1.0, bool force = false);
47 void DetachAllObjects();
48 void AttachObject(Ogre::MovableObject *object);
49 void DetachObject(Ogre::MovableObject *object);
50 Real GetScale();
51 void SetScale(Real scale);
52 SceneNode* CreateChild(std::string name, const Vector3 &offset = Vector3::ZERO);
53 std::string GetFullName();
54 bool IsRoot();
55 void Pitch(Real &degree);
56 void Yaw(Real &degree);
57 void Roll(Real &degree);
58 Vector3 GetDerivedPosition();
59 Quaternion GetDerivedOrientation();
60 void SetDirection(const Vector3 &direction);
61 void LookAt(const Vector3 &point);
62
63private:
64
65 Ogre::SceneNode *node; //node in scene graph
66 Vector3 Rotation; //rotation vector
67};
68
69}
70
71#endif
Ogre::SceneNode * GetRawSceneNode()
Definition scenenode.h:35
Ogre::SceneNode * node
Definition scenenode.h:65
Vector3 Rotation
Definition scenenode.h:66
Ogre::Vector3 Vector3
Definition globals.h:58
Ogre::Real Real
Definition globals.h:57
#define SBSIMPEXP
Definition globals.h:53
Ogre::Quaternion Quaternion
Definition globals.h:60