OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreSkeletonDef.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-2014 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 __SkeletonDef_H__
30 #define __SkeletonDef_H__
31 
32 #include "OgreSkeletonAnimation.h"
34 #include "OgreIdString.h"
35 #include "OgreRawPtr.h"
36 
38 
39 namespace Ogre
40 {
42  {
43  friend class SkeletonInstance;
44  public:
45  struct BoneData
46  {
47  size_t index;
48  size_t parent;
53  uint8 bInheritOrientation:1;
54  uint8 bInheritScale:1;
55 
56  BoneData( size_t _index, size_t _parent, const Vector3 &_pos, const Quaternion &_rot,
57  const Vector3 &_scale, const String &_name,
58  bool _inheritOrientation, bool _inheritScale ) :
59  index( _index ),
60  parent( _parent ),
61  vPos( _pos ),
62  qRot( _rot ),
63  vScale( _scale ),
64  name( _name ),
65  bInheritOrientation( _inheritOrientation ),
66  bInheritScale( _inheritScale )
67  {
68  }
69  };
71 
73  {
76  DepthLevelInfo() : firstBoneIndex( -1 ), numBonesInLevel( 0 ) {}
77  };
78 
80 
81  protected:
83 
87 
90 
92 
95 
97 
99 
100  public:
107  SkeletonDef( const Skeleton *originalSkeleton, Real frameRate );
108 
109  const String& getName(void) const { return mName; }
110 
111  const BoneDataVec& getBones(void) const { return mBones; }
112  const SkeletonAnimationDefVec& getAnimationDefs(void) const { return mAnimationDefs; }
113  const DepthLevelInfoVec& getDepthLevelInfo(void) const { return mDepthLevelInfoVec; }
114  const KfTransform * getBindPose(void) const { return mBindPose.get(); }
116  getReverseBindPose(void) const { return mReverseBindPose; }
117  void getBonesPerDepth( vector<size_t>::type &out ) const;
118 
125  size_t getNumberOfBoneBlocks( size_t numLevels ) const;
126  };
127 }
128 
129 #endif
unsigned char uint8
Definition: OgrePlatform.h:422
BoneDataVec mBones
map< IdString, size_t >::type BoneNameMap
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:255
RawSimdUniquePtr< ArrayMatrixAf4x3, MEMCATEGORY_ANIMATION > mReverseBindPose
RawSimdUniquePtr< KfTransform, MEMCATEGORY_ANIMATION > mBindPose
const BoneDataVec & getBones(void) const
vector< SkeletonAnimationDef >::type SkeletonAnimationDefVec
vector< list< size_t >::type >::type mBonesPerDepth
const DepthLevelInfoVec & getDepthLevelInfo(void) const
BoneNameMap mBoneIndexByName
const RawSimdUniquePtr< ArrayMatrixAf4x3, MEMCATEGORY_ANIMATION > & getReverseBindPose(void) const
Implementation of a Quaternion, i.e.
Similar to std::unique_ptr, but: Uses a custom allocator (OGRE_MALLOC_SIMD) Pointers must be really u...
Definition: OgreRawPtr.h:51
Holds the transform of a KeyFrame (which is part of an animation)
vector< DepthLevelInfo >::type DepthLevelInfoVec
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
DepthLevelInfoVec mDepthLevelInfoVec
Standard 3-dimensional vector.
Definition: OgreVector3.h:50
const SkeletonAnimationDefVec & getAnimationDefs(void) const
const String & getName(void) const
const KfTransform * getBindPose(void) const
_StringBase String
Definition: OgreCommon.h:53
SkeletonAnimationDefVec mAnimationDefs
size_t mNumUnusedSlots
Cached for SkeletonInstance::mUnusedNodes.
vector< BoneData >::type BoneDataVec
A collection of OldBone objects used to animate a skinned mesh.
Definition: OgreSkeleton.h:84
Instance of a Skeleton, main external interface for retrieving bone positions and applying animations...
BoneData(size_t _index, size_t _parent, const Vector3 &_pos, const Quaternion &_rot, const Vector3 &_scale, const String &_name, bool _inheritOrientation, bool _inheritScale)