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 
134  Node* createChildImpl(void);
136  Node* createChildImpl(const String& name);
137 
140 
147  };
148 
152 }
153 
154 #endif
#define _OgreExport
Definition: OgrePlatform.h:257
Implementation of a Quaternion, i.e.
A collection of Bone objects used to animate a skinned mesh.
Definition: OgreSkeleton.h:87
const Quaternion & _getBindingPoseInverseOrientation(void) const
Gets the inverted binding pose orientation.
Definition: OgreBone.h:120
unsigned short mHandle
The numeric handle of this bone.
Definition: OgreBone.h:128
Quaternion mBindDerivedInverseOrientation
The inversed derived orientation of the bone in the binding pose.
Definition: OgreBone.h:144
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
A bone in a skeleton.
Definition: OgreBone.h:51
Class representing a general-purpose node an articulated scene graph.
Definition: OgreNode.h:64
const Vector3 & _getBindingPoseInverseScale(void) const
Gets the inverted binding pose scale.
Definition: OgreBone.h:116
Vector3 mBindDerivedInversePosition
The inversed derived position of the bone in the binding pose.
Definition: OgreBone.h:146
_StringBase String
Skeleton * mCreator
Pointer back to creator, for child creation (not smart ptr so child does not preserve parent) ...
Definition: OgreBone.h:139
bool mManuallyControlled
Bones set as manuallyControlled are not reseted in Skeleton::reset()
Definition: OgreBone.h:131
const Vector3 & _getBindingPoseInversePosition(void) const
Gets the inverted binding pose position.
Definition: OgreBone.h:118
static const Quaternion IDENTITY
Vector3 mBindDerivedInverseScale
The inversed derived scale of the bone in the binding pose.
Definition: OgreBone.h:142
static const Vector3 ZERO
Definition: OgreVector3.h:800

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri Dec 20 2013 01:24:15