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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.