OGRE  1.9.0
OgreSkeletonInstance.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 __SkeletonInstance_H__
30#define __SkeletonInstance_H__
31
32#include "OgrePrerequisites.h"
33#include "OgreSkeleton.h"
34#include "OgreHeaderPrefix.h"
35
36namespace Ogre {
37
54 {
55 public:
59 SkeletonInstance(const SkeletonPtr& masterCopy);
61
63 unsigned short getNumAnimations(void) const;
64
66 Animation* getAnimation(unsigned short index) const;
69 const LinkedSkeletonAnimationSource** linker = 0) const;
70
77 Animation* createAnimation(const String& name, Real length);
78
81 const LinkedSkeletonAnimationSource** linker = 0) const;
82
87 void removeAnimation(const String& name);
88
89
92 const Quaternion &offsetOrientation = Quaternion::IDENTITY,
93 const Vector3 &offsetPosition = Vector3::ZERO);
94
96 void freeTagPoint(TagPoint* tagPoint);
97
100 Real scale = 1.0f);
106
109
112
114 const String& getName(void) const;
118 const String& getGroup(void);
119
120 protected:
123
125
135
144
147
148 void cloneBoneAndChildren(Bone* source, Bone* parent);
151 void loadImpl(void);
154 void unloadImpl(void);
155
156 };
160}
161
162#include "OgreHeaderSuffix.h"
163
164#endif
165
#define _OgreExport
Class encapsulating a set of AnimationState objects.
An animation sequence.
A bone in a skeleton.
Definition OgreBone.h:52
Concrete IteratorWrapper for const access to the underlying container.
Implementation of a Quaternion, i.e.
A SkeletonInstance is a single instance of a Skeleton used by a world object.
unsigned short mNextTagPointAutoHandle
TagPoint automatic handles.
SkeletonPtr mSkeleton
Pointer back to master Skeleton.
void cloneBoneAndChildren(Bone *source, Bone *parent)
TagPoint * createTagPointOnBone(Bone *bone, const Quaternion &offsetOrientation=Quaternion::IDENTITY, const Vector3 &offsetPosition=Vector3::ZERO)
Creates a TagPoint ready to be attached to a bone.
SkeletonInstance(const SkeletonPtr &masterCopy)
Constructor, don't call directly, this will be created automatically when you create an Entity based ...
void addLinkedSkeletonAnimationSource(const String &skelName, Real scale=1.0f)
Allows you to use the animations from another Skeleton object to animate this skeleton.
unsigned short getNumAnimations(void) const
Gets the number of animations on this skeleton.
void unloadImpl(void)
Overridden from Skeleton.
void removeAllLinkedSkeletonAnimationSources(void)
Remove all links to other skeletons for the purposes of sharing animation.
Animation * getAnimation(unsigned short index) const
Gets a single animation by index.
TagPointList mActiveTagPoints
Active tag point list.
const String & getName(void) const
Gets resource name.
Animation * getAnimation(const String &name, const LinkedSkeletonAnimationSource **linker=0) const
Returns the named Animation object.
void loadImpl(void)
Overridden from Skeleton.
Animation * createAnimation(const String &name, Real length)
Creates a new Animation object for animating this skeleton.
list< TagPoint * >::type TagPointList
void _initAnimationState(AnimationStateSet *animSet)
Initialise an animation set suitable for use with this skeleton.
TagPointList mFreeTagPoints
Free tag point list.
LinkedSkeletonAnimSourceIterator getLinkedSkeletonAnimationSourceIterator(void) const
Get an iterator over the linked skeletons used as animation sources.
void _refreshAnimationState(AnimationStateSet *animSet)
Refresh an animation set suitable for use with this skeleton.
Animation * _getAnimationImpl(const String &name, const LinkedSkeletonAnimationSource **linker=0) const
Internal accessor for animations (returns null if animation does not exist)
ResourceHandle getHandle(void) const
const String & getGroup(void)
Gets the group which this resource is a member of.
void removeAnimation(const String &name)
Removes an Animation from this skeleton.
void freeTagPoint(TagPoint *tagPoint)
Frees a TagPoint that already attached to a bone.
A collection of Bone objects used to animate a skinned mesh.
A tagged point on a skeleton, which can be used to attach entities to on specific other entities.
Standard 3-dimensional vector.
Definition OgreVector3.h:52
float Real
Software floating point type.
unsigned long long int ResourceHandle
_StringBase String
Link to another skeleton to share animations.
std::list< T, A > type