41SAnim::SAnim(
SScene* scene,
const std::string& animationName,
SNode* animationAssociatedNode,
const unsigned short& animationId,
const AnimType& animationType) :
SData(animationName), type(animationType)
44 bUpdatedBySequence = 0;
47 associatedNode = animationAssociatedNode;
48 animationIndex = animationId;
54 Ogre::Root::getSingleton().addFrameListener(ogreAnimationFrameListener);
57SAnim::SAnim() :
SData(
""), type(SO3_UNKNOWN_ANIM)
64 Ogre::Root::getSingleton().removeFrameListener(ogreAnimationFrameListener);
65 delete(ogreAnimationFrameListener);
66 ogreAnimationFrameListener = 0;
70 SAnimMap::const_iterator iSeqAnim = seqAnimCopy.begin();
71 while(iSeqAnim != seqAnimCopy.end())
73 SAnim* seqanim = iSeqAnim->second;
79 SAnimTrackList::const_iterator iSeqTrack = SeqTrackCopy.begin();
80 while(iSeqTrack != SeqTrackCopy.end())
87 catch(Ogre::Exception)
98 SAnimTrackList::iterator iAnimTrack = animationTrackListCopy.begin();
99 while(iAnimTrack != animationTrackListCopy.end())
102 SO3_SAFE_DELETE(*iAnimTrack);
122 return associatedNode;
132 return animationIndex;
151 if(newAnimationTrack == 0)
152 OGRE_EXCEPT(Ogre::Exception::ERR_NOT_IMPLEMENTED,
"Can not create animation track named \""+ newAnimationTrackName +
"\", this animation type may not handle user creation!",
"SAnim::CreateAnimationTrack");
155 return newAnimationTrack;
166 SO3_SAFE_DELETE(existingAnimationTrack);
277 ogreAnimation->setInterpolationMode(
static_cast <Ogre::Animation::InterpolationMode
> (
static_cast<int> (interpolationMode)));
287 ogreAnimation->setRotationInterpolationMode(
static_cast <Ogre::Animation::RotationInterpolationMode
> (
static_cast<int> (interpolationMode)));
359 isPaused = pauseState;
375 animation = animationListened;
394 return (bUpdatedBySequence > 0);
400 bUpdatedBySequence ++;
402 bUpdatedBySequence --;
SScene * GetParentScene()
void RemoveAnimationTrack(SAnimTrack *existingAnimationTrack)
virtual void SetTimePosition(const float &timePosition)
virtual void _UpdateImpl(const Ogre::FrameEvent &evt)
void AddTime(const float &time)
void SetInitialLoop(const bool &loop)
void SetOptimise(const bool &optimize)
void DeleteAnimationTrack(SAnimTrack *existingAnimationTrack)
virtual SAnimTrack * CreateAnimationTrackImpl(const std::string &newAnimationTrackName)
AnimRotationInterpolationMode
virtual void SetWeight(const float &weight)
void Update(const Ogre::FrameEvent &evt)
virtual Ogre::AnimationState * _GetOgreAnimationState()=0
void Apply(const float &timePosition)
SAnimTrack * GetAnimationTrack(const unsigned short &index)
Ogre::Animation * GetOgreAnimationPointer()
unsigned short GetIndex()
AnimInterpolationMode GetInterpolationMode()
void SetLoop(const bool &loop)
SAnimTrack * CreateAnimationTrack(const std::string &newAnimationTrackName)
virtual void SetEnable(const bool &enable)
AnimRotationInterpolationMode GetRotationInterpolationMode()
void SetRotationInterpolationMode(const AnimRotationInterpolationMode &interpolationMode)
unsigned short GetNumAnimationsTracks()
void SetPaused(const bool &pauseState)
void AddAnimationTrack(SAnimTrack *existingAnimationTrack)
Ogre::Animation * ogreAnimation
void SetLength(const float &length)
void SetInitialWeight(const float &weight)
virtual float GetWeight()
SAnimTrackList animationTrackList
void SetInterpolationMode(const AnimInterpolationMode &interpolationMode)
void SetSpeed(const float &newSpeed)
void SetSequenceUpdated(const bool &value)
SAnimTrackList GetAnimationsTracks() const
void SetSkipFrame(const bool &state)
~SAnimationFrameListener()
SAnimationFrameListener(SAnim *animationListened)
bool frameStarted(const Ogre::FrameEvent &evt)
SAnimMap GetAnimations() const
Ogre::SceneManager * GetOgreScenePointer()
void RemoveKeysWithAnim(SAnim *anim, const bool &reset)
std::vector< SAnimTrack * > SAnimTrackList
std::unordered_map< std::string, SAnim * > SAnimMap