SO3Engine
SO3Bone.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
32#ifndef __SO3BONE_H__
33#define __SO3BONE_H__
34
37
38namespace SO3
39{
40
41class SBone : public SNode
42{
43friend class SNode;
44public:
45protected:
47 Ogre::Entity* ogreLinkedEntity;
48 unsigned short boneIndex;
49private:
50
51public:
54 SBone(SScene* parent, const std::string& boneName, SSkeleton* skeleton, const unsigned short& id);
55
58 ~SBone();
59
62 void UnsetSkeleton();
63
66 Ogre::Bone* GetOgreBonePointer();
67
71
75 virtual void Rotate(const Ogre::Vector3& axis, const float& radianAngle, const SNode::NodeTransformSpace& relativeTo=SNode::SO3_LOCAL_TS);
76
80 virtual void SetOrientation(const Ogre::Quaternion& quat);
81
85 virtual void AddOrientation(const Ogre::Quaternion& quat);
86
90 virtual void ResetToInitialOrientation();
91
95 virtual void SetPosition(const Ogre::Vector3& pos);
96
100 virtual void Translate(const Ogre::Vector3& d, const SNode::NodeTransformSpace& relativeTo=SNode::SO3_PARENT_TS);
101
105 virtual void SetScale(const Ogre::Vector3& scale);
106
110 virtual Ogre::Vector3 GetPosition();
111
115 virtual Ogre::Quaternion GetOrientation();
116
120 virtual Ogre::Vector3 GetScale();
121
125 virtual Ogre::Vector3 GetInitialPosition();
126
130 virtual Ogre::Quaternion GetInitialOrientation();
131
135 virtual Ogre::Vector3 GetInitialScale();
136
140 virtual Ogre::Vector3 GetGlobalPosition();
141
145 virtual Ogre::Quaternion GetGlobalOrientation();
146
150 virtual Ogre::Vector3 GetGlobalScale();
151
155 virtual void SetGlobalPosition(const Ogre::Vector3& pos, bool updateBody = true);
156
160 virtual void SetGlobalOrientation(const Ogre::Quaternion& quat, bool updateBody = true);
161
165 virtual void SetGlobalScale(const Ogre::Vector3& pos, bool updateBody = true);
166
170 virtual Ogre::Matrix4 GetTransformationMatrix();
171
175 virtual void Pitch(const float& radianAngle, const SNode::NodeTransformSpace& relativeTo=SNode::SO3_LOCAL_TS);
176
180 virtual void Yaw(const float& radianAngle, const SNode::NodeTransformSpace& relativeTo=SNode::SO3_LOCAL_TS);
181
185 virtual void Roll(const float& radianAngle, const SNode::NodeTransformSpace& relativeTo=SNode::SO3_LOCAL_TS);
186
190 virtual int GetNumChildren();
191
195 virtual void StoreInitialPRS();
196
200 virtual void ResetToInitialPRS();
201
204 unsigned short GetIndex();
205
208 Ogre::Quaternion ConvertWorldToLocalOrientation(const Ogre::Quaternion& quat);
209
212 virtual void SetInheritOrientation(const bool& state);
213
216 virtual bool GetInheritOrientation();
217
220 virtual void ResetOrientation();
221
224 void AttachToBone(Ogre::MovableObject* ogreObject);
225
228 void DetachFromBone(Ogre::MovableObject* ogreObject);
229
230protected:
233 void AttachToBone(SNode* newChild);
234
237 void DetachFromBone(SNode* existingChild);
238private:
242 SBone();
243};
244
245}
246
247#endif
librairies include
virtual void SetOrientation(const Ogre::Quaternion &quat)
Definition SO3Bone.cpp:97
void UnsetSkeleton()
Definition SO3Bone.cpp:64
Ogre::Bone * GetOgreBonePointer()
Definition SO3Bone.cpp:70
unsigned short GetIndex()
Definition SO3Bone.cpp:474
virtual void Pitch(const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
Definition SO3Bone.cpp:386
virtual void SetPosition(const Ogre::Vector3 &pos)
Definition SO3Bone.cpp:141
SSkeleton * GetSkeleton()
Definition SO3Bone.cpp:78
virtual Ogre::Quaternion GetInitialOrientation()
Definition SO3Bone.cpp:219
virtual void SetGlobalPosition(const Ogre::Vector3 &pos, bool updateBody=true)
Definition SO3Bone.cpp:295
virtual void Rotate(const Ogre::Vector3 &axis, const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
Definition SO3Bone.cpp:83
virtual bool GetInheritOrientation()
Definition SO3Bone.cpp:576
unsigned short boneIndex
Definition SO3Bone.h:48
virtual Ogre::Vector3 GetPosition()
Definition SO3Bone.cpp:183
void AttachToBone(Ogre::MovableObject *ogreObject)
Definition SO3Bone.cpp:538
virtual void ResetToInitialOrientation()
Definition SO3Bone.cpp:127
virtual void Roll(const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
Definition SO3Bone.cpp:412
virtual void Translate(const Ogre::Vector3 &d, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_PARENT_TS)
Definition SO3Bone.cpp:155
virtual Ogre::Vector3 GetInitialPosition()
Definition SO3Bone.cpp:210
void DetachFromBone(Ogre::MovableObject *ogreObject)
Definition SO3Bone.cpp:550
virtual void SetGlobalOrientation(const Ogre::Quaternion &quat, bool updateBody=true)
Definition SO3Bone.cpp:328
virtual void AddOrientation(const Ogre::Quaternion &quat)
Definition SO3Bone.cpp:113
virtual void Yaw(const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
Definition SO3Bone.cpp:399
virtual void SetScale(const Ogre::Vector3 &scale)
Definition SO3Bone.cpp:169
virtual void ResetOrientation()
Definition SO3Bone.cpp:585
virtual Ogre::Vector3 GetScale()
Definition SO3Bone.cpp:201
virtual Ogre::Quaternion GetGlobalOrientation()
Definition SO3Bone.cpp:256
virtual void SetInheritOrientation(const bool &state)
Definition SO3Bone.cpp:567
virtual Ogre::Matrix4 GetTransformationMatrix()
Definition SO3Bone.cpp:377
Ogre::Entity * ogreLinkedEntity
Definition SO3Bone.h:47
virtual int GetNumChildren()
Definition SO3Bone.cpp:425
SSkeleton * parentSkeleton
Definition SO3Bone.h:46
virtual Ogre::Vector3 GetGlobalPosition()
Definition SO3Bone.cpp:238
Ogre::Quaternion ConvertWorldToLocalOrientation(const Ogre::Quaternion &quat)
Definition SO3Bone.cpp:558
virtual void SetGlobalScale(const Ogre::Vector3 &pos, bool updateBody=true)
Definition SO3Bone.cpp:355
virtual void ResetToInitialPRS()
Definition SO3Bone.cpp:449
virtual Ogre::Quaternion GetOrientation()
Definition SO3Bone.cpp:192
virtual Ogre::Vector3 GetGlobalScale()
Definition SO3Bone.cpp:275
virtual void StoreInitialPRS()
Definition SO3Bone.cpp:434
virtual Ogre::Vector3 GetInitialScale()
Definition SO3Bone.cpp:228