57#define OGRE_MAX_NUM_BONES 256
60 struct LinkedSkeletonAnimationSource;
208 virtual void reset(
bool resetManualBones =
false);
An animation container interface, which allows generic access to sibling animations.
Class encapsulating a set of AnimationState objects.
Concrete IteratorWrapper for const access to the underlying container.
Interface describing a manual resource loader.
Class encapsulating a standard 4x4 homogeneous matrix.
Defines a generic resource handler.
Abstract class representing a loadable resource (e.g.
Reference-counted shared pointer, used for objects where implicit destruction is required.
A SkeletonInstance is a single instance of a Skeleton used by a world object.
A collection of Bone objects used to animate a skinned mesh.
size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
BoneList mBoneList
Storage of bones, indexed by bone handle.
virtual void _notifyManualBonesDirty(void)
Internal method for marking the manual bones as dirty.
virtual bool getManualBonesDirty(void) const
Have manual bones been modified since the skeleton was last updated?
virtual void setBlendMode(SkeletonAnimationBlendMode state)
Sets the animation blending mode this skeleton will use.
virtual Bone * createBone(const String &name, unsigned short handle)
Creates a brand new Bone owned by this Skeleton.
virtual Bone * createBone(void)
Creates a brand new Bone owned by this Skeleton.
virtual void _mergeSkeletonAnimations(const Skeleton *source, const BoneHandleMap &boneHandleMap, const StringVector &animations=StringVector())
Merge animations from another Skeleton object into this skeleton.
virtual void addLinkedSkeletonAnimationSource(const String &skelName, Real scale=1.0f)
Allows you to use the animations from another Skeleton object to animate this skeleton.
virtual SkeletonAnimationBlendMode getBlendMode() const
Gets the animation blending mode which this skeleton will use.
virtual LinkedSkeletonAnimSourceIterator getLinkedSkeletonAnimationSourceIterator(void) const
Get an iterator over the linked skeletons used as animation sources.
virtual bool hasAnimation(const String &name) const
Returns whether this skeleton contains the named animation.
SkeletonAnimationBlendMode mBlendState
BoneSet mManualBones
Manual bones.
unsigned short mNextAutoHandle
Bone automatic handles.
BoneList mRootBones
Pointer to root bones (can now have multiple roots)
virtual bool hasBone(const String &name) const
Returns whether this skeleton contains the named bone.
void loadImpl(void)
Internal implementation of the meat of the 'load' action, only called if this resource is not being l...
virtual BoneIterator getBoneIterator(void)
Get an iterator over all the bones in the skeleton.
virtual void setAnimationState(const AnimationStateSet &animSet)
Changes the state of the skeleton to reflect the application of the passed in collection of animation...
virtual unsigned short getNumAnimations(void) const
Gets the number of animations on this skeleton.
void _dumpContents(const String &filename)
Debugging method.
BoneListByName mBoneListByName
virtual void optimiseAllAnimations(bool preservingIdentityNodeTracks=false)
Optimise all of this skeleton's animations.
void deriveRootBone(void) const
Internal method which parses the bones to derive the root bone.
virtual void _updateTransforms(void)
Updates all the derived transforms in the skeleton.
virtual Animation * getAnimation(const String &name, const LinkedSkeletonAnimationSource **linker) const
Returns the named Animation object.
Skeleton()
Internal constructor for use by SkeletonInstance only.
virtual void _buildMapBoneByHandle(const Skeleton *source, BoneHandleMap &boneHandleMap) const
Build the bone handle map to use with Skeleton::_mergeSkeletonAnimations.
Skeleton(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
Constructor, don't call directly, use SkeletonManager.
virtual Animation * getAnimation(const String &name) const
Returns the named Animation object.
virtual Bone * createBone(const String &name)
Creates a brand new Bone owned by this Skeleton.
virtual void removeAnimation(const String &name)
Removes an Animation from this skeleton.
virtual void removeAllLinkedSkeletonAnimationSources(void)
Remove all links to other skeletons for the purposes of sharing animation.
vector< Bone * >::type BoneList
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
virtual Animation * _getAnimationImpl(const String &name, const LinkedSkeletonAnimationSource **linker=0) const
Internal accessor for animations (returns null if animation does not exist)
virtual Animation * createAnimation(const String &name, Real length)
Creates a new Animation object for animating this skeleton.
virtual Animation * getAnimation(unsigned short index) const
Gets a single animation by index.
vector< ushort >::type BoneHandleMap
Map to translate bone handle from one skeleton to another skeleton.
virtual void reset(bool resetManualBones=false)
Resets the position and orientation of all bones in this skeleton to their original binding position.
map< String, Animation * >::type AnimationList
Storage of animations, lookup by name.
VectorIterator< BoneList > BoneIterator
virtual void _buildMapBoneByName(const Skeleton *source, BoneHandleMap &boneHandleMap) const
Build the bone handle map to use with Skeleton::_mergeSkeletonAnimations.
bool mManualBonesDirty
Manual bones dirty?
virtual void _refreshAnimationState(AnimationStateSet *animSet)
Refresh an animation set suitable for use with this skeleton.
virtual Bone * getRootBone(void) const
Gets the root bone of the skeleton: deprecated in favour of getRootBoneIterator.
map< String, Bone * >::type BoneListByName
Lookup by bone name.
set< Bone * >::type BoneSet
virtual BoneIterator getRootBoneIterator(void)
Get an iterator over the root bones in the skeleton, ie those with no parents.
virtual Bone * getBone(unsigned short handle) const
Gets a bone by it's handle.
vector< LinkedSkeletonAnimationSource >::type LinkedSkeletonAnimSourceList
virtual void _notifyManualBoneStateChange(Bone *bone)
Internal method for notifying that a bone is manual.
LinkedSkeletonAnimSourceList mLinkedSkeletonAnimSourceList
List of references to other skeletons to use animations from.
virtual void _getBoneMatrices(Matrix4 *pMatrices)
Populates the passed in array with the bone matrices based on the current position.
AnimationList mAnimationsList
virtual bool hasManualBones(void) const
Are there any manually controlled bones?
virtual Bone * getBone(const String &name) const
Gets a bone by it's name.
virtual void setBindingPose(void)
Sets the current position / orientation to be the 'binding pose' i.e.
ConstVectorIterator< LinkedSkeletonAnimSourceList > LinkedSkeletonAnimSourceIterator
virtual unsigned short getNumBones(void) const
Returns the number of bones in this skeleton.
virtual void _initAnimationState(AnimationStateSet *animSet)
Initialise an animation set suitable for use with this skeleton.
virtual Bone * createBone(unsigned short handle)
Creates a brand new Bone owned by this Skeleton.
Concrete IteratorWrapper for nonconst access to the underlying container.
SkeletonAnimationBlendMode
SharedPtr< Skeleton > SkeletonPtr
@ ANIMBLEND_AVERAGE
Animations are applied by calculating a weighted average of all animations.
@ ANIMBLEND_CUMULATIVE
Animations are applied by calculating a weighted cumulative total.
vector< String >::type StringVector
float Real
Software floating point type.
unsigned long long int ResourceHandle
Link to another skeleton to share animations.
LinkedSkeletonAnimationSource(const String &skelName, Real scl)
LinkedSkeletonAnimationSource(const String &skelName, Real scl, SkeletonPtr skelPtr)
std::map< K, V, P, A > type