OGRE  1.9.0
OgreBone.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28
29#ifndef __Bone_H__
30#define __Bone_H__
31
32#include "OgrePrerequisites.h"
33#include "OgreNode.h"
34
35
36namespace Ogre
37{
51 class _OgreExport Bone : public Node
52 {
53 public:
55 Bone(unsigned short handle, Skeleton* creator);
57 Bone(const String& name, unsigned short handle, Skeleton* creator);
59
71 Bone* createChild(unsigned short handle,
72 const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
73
74
76 unsigned short getHandle(void) const;
77
81 void setBindingPose(void);
82
89 void reset(void);
90
103 void setManuallyControlled(bool manuallyControlled);
104
107
108
114
116 const Vector3& _getBindingPoseInverseScale(void) const { return mBindDerivedInverseScale; }
118 const Vector3& _getBindingPoseInversePosition(void) const { return mBindDerivedInversePosition; }
120 const Quaternion& _getBindingPoseInverseOrientation(void) const { return mBindDerivedInverseOrientation; }
121
123 void needUpdate(bool forceParentUpdate = false);
124
125
126 protected:
128 unsigned short mHandle;
129
132
137
140
147 };
148
152}
153
154#endif
#define _OgreExport
Definition: OgrePlatform.h:260
A bone in a skeleton.
Definition: OgreBone.h:52
bool isManuallyControlled() const
Getter for mManuallyControlled Flag.
Vector3 mBindDerivedInverseScale
The inversed derived scale of the bone in the binding pose.
Definition: OgreBone.h:142
void reset(void)
Resets the position and orientation of this Bone to the original binding position.
unsigned short mHandle
The numeric handle of this bone.
Definition: OgreBone.h:128
void needUpdate(bool forceParentUpdate=false)
Vector3 mBindDerivedInversePosition
The inversed derived position of the bone in the binding pose.
Definition: OgreBone.h:146
Bone(unsigned short handle, Skeleton *creator)
Constructor, not to be used directly (use Bone::createChild or Skeleton::createBone)
Skeleton * mCreator
Pointer back to creator, for child creation (not smart ptr so child does not preserve parent)
Definition: OgreBone.h:139
void setBindingPose(void)
Sets the current position / orientation to be the 'binding pose' ie the layout in which bones were or...
const Vector3 & _getBindingPoseInversePosition(void) const
Gets the inverted binding pose position.
Definition: OgreBone.h:118
Node * createChildImpl(void)
See Node.
const Quaternion & _getBindingPoseInverseOrientation(void) const
Gets the inverted binding pose orientation.
Definition: OgreBone.h:120
Bone * createChild(unsigned short handle, const Vector3 &translate=Vector3::ZERO, const Quaternion &rotate=Quaternion::IDENTITY)
Creates a new Bone as a child of this bone.
unsigned short getHandle(void) const
Gets the numeric handle for this bone (unique within the skeleton).
bool mManuallyControlled
Bones set as manuallyControlled are not reseted in Skeleton::reset()
Definition: OgreBone.h:131
const Vector3 & _getBindingPoseInverseScale(void) const
Gets the inverted binding pose scale.
Definition: OgreBone.h:116
Quaternion mBindDerivedInverseOrientation
The inversed derived orientation of the bone in the binding pose.
Definition: OgreBone.h:144
void _getOffsetTransform(Matrix4 &m) const
Gets the transform which takes bone space to current from the binding pose.
Node * createChildImpl(const String &name)
See Node.
Bone(const String &name, unsigned short handle, Skeleton *creator)
Constructor, not to be used directly (use Bone::createChild or Skeleton::createBone)
void setManuallyControlled(bool manuallyControlled)
Sets whether or not this bone is manually controlled.
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
Class representing a general-purpose node an articulated scene graph.
Definition: OgreNode.h:65
Implementation of a Quaternion, i.e.
A collection of Bone objects used to animate a skinned mesh.
Definition: OgreSkeleton.h:88
Standard 3-dimensional vector.
Definition: OgreVector3.h:52
_StringBase String