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);
40 void SetPositionRelative(const Vector3 &position);
41 Vector3 GetPosition(bool relative = false);
42 void SetRotation(const Vector3 &rotation);
43 Vector3 GetRotation();
44 void Update();
45 Quaternion GetOrientation(bool relative = false);
46 void SetOrientation(const Quaternion &q, bool relative = false);
47 void Move(const Vector3 &vector, Real speed = 1.0);
48 void DetachAllObjects();
49 void AttachObject(Ogre::MovableObject *object);
50 void DetachObject(Ogre::MovableObject *object);
51 Real GetScale();
52 void SetScale(Real scale);
53 SceneNode* CreateChild(std::string name, const Vector3 &offset = Vector3::ZERO);
54 std::string GetFullName();
55 bool IsRoot();
56 void Pitch(Real &degree);
57 void Yaw(Real &degree);
58 void Roll(Real &degree);
59 Vector3 GetDerivedPosition();
60 Quaternion GetDerivedOrientation();
61 void SetDirection(const Vector3 &direction);
62 void LookAt(const Vector3 &point);
63
64private:
65
66 Ogre::SceneNode *node; //node in scene graph
67 Vector3 Rotation; //rotation vector
68};
69
70}
71
72#endif
Ogre::SceneNode * GetRawSceneNode()
Definition scenenode.h:35
Ogre::SceneNode * node
Definition scenenode.h:66
Vector3 Rotation
Definition scenenode.h:67
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