Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OgreSkeletonInstance.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004 (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 #ifndef __SkeletonInstance_H__
00027 #define __SkeletonInstance_H__
00028 
00029 #include "OgrePrerequisites.h"
00030 #include "OgreSkeleton.h"
00031 
00032 namespace Ogre {
00033 
00043     class _OgreExport SkeletonInstance : public Skeleton
00044     {
00045     public:
00049         SkeletonInstance(const SkeletonPtr& masterCopy);
00050         ~SkeletonInstance();
00051 
00053         unsigned short getNumAnimations(void) const;
00054 
00056         Animation* getAnimation(unsigned short index) const;
00058         Animation* _getAnimationImpl(const String& name, 
00059             const LinkedSkeletonAnimationSource** linker = 0) const;
00060 
00067         Animation* createAnimation(const String& name, Real length);
00068 
00070         Animation* getAnimation(const String& name, 
00071             const LinkedSkeletonAnimationSource** linker = 0) const;
00072 
00077         void removeAnimation(const String& name);
00078 
00079 
00081         TagPoint* createTagPointOnBone(Bone* bone, 
00082             const Quaternion &offsetOrientation = Quaternion::IDENTITY, 
00083             const Vector3 &offsetPosition = Vector3::ZERO);
00084 
00086         void freeTagPoint(TagPoint* tagPoint);
00087 
00089         void addLinkedSkeletonAnimationSource(const String& skelName, 
00090             Real scale = 1.0f);
00092         void removeAllLinkedSkeletonAnimationSources(void);
00094         LinkedSkeletonAnimSourceIterator 
00095             getLinkedSkeletonAnimationSourceIterator(void) const;
00096 
00098         void _initAnimationState(AnimationStateSet* animSet);
00099 
00101         void _refreshAnimationState(AnimationStateSet* animSet);
00102 
00104         const String& getName(void) const;
00106         ResourceHandle getHandle(void) const;
00108         const String& getGroup(void);
00109 
00110     protected:
00112         SkeletonPtr mSkeleton;
00113 
00114         typedef std::list<TagPoint*> ActiveTagPointList;
00115         typedef std::deque<TagPoint*> FreeTagPointQueue;
00116 
00125         ActiveTagPointList mActiveTagPoints;
00126 
00134         FreeTagPointQueue mFreeTagPoints;
00135 
00137         unsigned short mNextTagPointAutoHandle;
00138 
00139         void cloneBoneAndChildren(Bone* source, Bone* parent);
00142         void loadImpl(void);
00145         void unloadImpl(void);
00146 
00147     };
00148 
00149 }
00150 
00151 
00152 #endif
00153 

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Sep 17 15:39:12 2006