I need for personnal purpoise to develop an animation frame callback system, and I've seen that is a requested feature for Ogre( http://www.ogre3d.org/tikiwiki/Help+Req ... _callbacks) , so why may I develop it only for myself while it is a needed feature.
So the needs are, according to the wiki:
* Enhance the .skeleton format to include frame events in animations
* Allow listeners to be registered on AnimationState to receive event notifications
* Events raised must be aware of interpolation (skipping over the event, time distances)
The implementation basis I've seen is to add
Code: Select all
addAnimationFrameListener(AnimationListener*)
addAnimationTimeListener( AnimationListener*)
Code: Select all
addFrameEvent(ogre::string& animName,int frame)
addTimeEvent(ogre::string &animName,float frame)
to the skeleton class with the AnimationListener having two methods:
Code: Select all
AnimationListener::frameEventRaised(Ogre::string &animname,int frame)
AnimationListener::timeEventRaised(Ogre::string &animname,float time)
-if the current frame/time is listened or if there was a listened frame/time during the last time increment, wake up listener. It somehow a backward looking system.
-if the current frame/time is listened, or if there is a listened frame/time during the next estimated time increment, wake up listener. A forward looking system.
-if the current frame/time is listened, or if there is a listened frame/time in the [currentFrame-delta, currentFrame+delta] intervall, delta beeing given by the user while registering the listener, wake up the listener.
I don't know which one to choose, maybe let the user choose it having different type of listeners.
Any other thought on this feature?