The Nebula Device 3: Animation::AnimSequencer Class Reference

The Nebula Device 3

Animation::AnimSequencer Class Reference

#include <animsequencer.h>


Detailed Description

An AnimSequencer object arranges AnimJobs along the time line to produce a single, priority-blended result. AnimJobs which are overlapping on the time-line will be blended by the following rules:

  • AnimJobs with a higher blend priority dominate lower-priority anim jobs
  • if AnimJobs have the same blend priority, the start time of the anim job is used to determine blend priority (jobs which start later dominate jobs which start earlier)

(C) 2008 Radon Labs GmbH

Public Member Functions

 AnimSequencer ()
 constructor
 ~AnimSequencer ()
 destructor
void Setup (const Ptr< CoreAnimation::AnimResource > &animResource)
 setup the animation controller
void Discard ()
 discard the anim sequencer
bool IsValid () const
 return true if between Setup/Discard
void SetDebugHudEnabled (bool b)
 enable/disable the debug hud
bool IsDebugHudEnabled () const
 get debug hud enabled state
void EnqueueAnimJob (const Ptr< AnimJob > &animJob)
 enqueue an anim job
void StopTrack (IndexT trackIndex, bool allowFadeOut=true)
 stop all anim jobs on given track
void StopAllTracks (bool allowFadeOut=true)
 stop all animations on all tracks
void UpdateTime (Timing::Tick time)
 update the animation sequencer time
bool StartAsyncEvaluation (const Ptr< Jobs::JobPort > &jobPort)
 start asynchronous animation update, returns false if nothing had to be done
Timing::Tick GetTime () const
 get the currently set time
const Ptr< CoreAnimation::AnimSampleBuffer > & GetResult () const
 get the final sampled result of the last evaluation
const Ptr< CoreAnimation::AnimResource > & GetAnimResource () const
 get pointer to animation resource object
Util::Array< Ptr< AnimJob > > GetAllAnimJobs () const
 get all anim jobs
Util::Array< Ptr< AnimJob > > GetAnimJobsByTrackIndex (IndexT trackIndex) const
 get currently active anim jobs filtered by track index
Util::Array< Ptr< AnimJob > > GetAnimJobsByName (const Util::StringAtom &name) const
 get anim jobs by name
Util::Array< AnimEventInfoEmitAnimEvents (Timing::Tick startTime, Timing::Tick endTime, bool justDominatingJob, const Util::String &optionalCatgeory="") const
 FIXME FIXME FIXME: emit anim event infos.

Member Function Documentation

void Animation::AnimSequencer::Discard (  ) 

discard the anim sequencer

FIXME: do we have to wait for the anim jobs to finish here??

void Animation::AnimSequencer::EnqueueAnimJob ( const Ptr< AnimJob > &  animJob  ) 

enqueue an anim job

Enqueue an anim job. This will schedule the anim job for insertion in the next Evaluate(). This deferred handling is necessary because the actual base time of the anim job job is only known in Evaluate() (need to be careful to prevent those pesky one-frame problems).

void Animation::AnimSequencer::StopTrack ( IndexT  trackIndex,
bool  allowFadeOut = true 
)

stop all anim jobs on given track

Stop or cancel all anim jobs on a given track.

void Animation::AnimSequencer::StopAllTracks ( bool  allowFadeOut = true  ) 

stop all animations on all tracks

Stop or cancel all anim jobs in the sequencer.

void Animation::AnimSequencer::UpdateTime ( Timing::Tick  curTime  ) 

update the animation sequencer time

Update the current time of the sequencer. This should be called exactly once per frame, even if the animated object is currently invisible (near the camera but outside the view volume). This will update the anim jobs which have been started or stopped this frame, and it will remove expired anim jobs, but will not sample the animation.

bool Animation::AnimSequencer::StartAsyncEvaluation ( const Ptr< Jobs::JobPort > &  jobPort  ) 

start asynchronous animation update, returns false if nothing had to be done

This method should be called once per-frame for each visible animated object AFTER UpdateTime() has been called. Actual animation sampling and mixing happens here.

Util::Array< AnimEventInfo > Animation::AnimSequencer::EmitAnimEvents ( Timing::Tick  startTime,
Timing::Tick  endTime,
bool  justDominatingJob,
const Util::String optionalCatgeory = "" 
) const

FIXME FIXME FIXME: emit anim event infos.

Collects all AnimEventInfos of all animjobs which are active in the given time range. If justDominatingJob flag is set, just use the clip with most blend factor.