Changeset 10394

Show
Ignore:
Timestamp:
06/24/09 12:10:09 (5 years ago)
Author:
cedricpinson
Message:

From Cedric Pinson, Fix the drop of the first frame of action when adding action with addActionNow\nReport stats only for active animations\nAdd priority to RunAction? callback

Location:
OpenSceneGraph/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgAnimation/ActionCallback

    r10344 r10394  
    1616#define OSGANIMATION_ACTION_CALLBACK_H 
    1717 
     18#include <osgAnimation/Export> 
    1819#include <osgAnimation/Action> 
    1920 
     
    2223 
    2324    /** Callback used to run new action on the timeline.*/ 
    24     class RunAction : public Action::Callback 
     25    class OSGANIMATION_EXPORT RunAction : public Action::Callback 
    2526    { 
    2627    public: 
    27         RunAction(Action* a) : _action(a) {} 
     28        RunAction(Action* a, int priority = 0) : _action(a), _priority(priority) {} 
    2829        virtual void operator()(Action* action, ActionVisitor* visitor); 
    2930 
    3031    protected: 
    3132        osg::ref_ptr<Action> _action; 
     33        int _priority; 
    3234         
    3335    }; 
  • OpenSceneGraph/trunk/src/osgAnimation/ActionCallback.cpp

    r10344 r10394  
    1919{ 
    2020    Timeline* tm = visitor->getCurrentTimeline(); 
    21     tm->addActionNow(_action.get()); 
     21    tm->addActionNow(_action.get(), _priority); 
    2222} 
    2323 
  • OpenSceneGraph/trunk/src/osgAnimation/StatsVisitor.cpp

    r10344 r10394  
    3333void osgAnimation::StatsActionVisitor::apply(Action& action) 
    3434{ 
    35     _channels.push_back(action.getName()); 
    36     _stats->setAttribute(_frame,action.getName(),0); 
    3735    if (isActive()) 
    3836    { 
     
    4442void osgAnimation::StatsActionVisitor::apply(BlendIn& action) 
    4543{ 
    46     _channels.push_back(action.getName()); 
    47     _stats->setAttribute(_frame,action.getName(),0); 
    4844    if (isActive())  
    4945    { 
     
    5551void osgAnimation::StatsActionVisitor::apply(BlendOut& action) 
    5652{ 
    57     _channels.push_back(action.getName()); 
    58     _stats->setAttribute(_frame,action.getName(),0); 
    5953    if (isActive())  
    6054    { 
     
    6660void osgAnimation::StatsActionVisitor::apply(ActionAnimation& action) 
    6761{ 
    68     _channels.push_back(action.getName()); 
    69     _stats->setAttribute(_frame,action.getName(),0); 
    7062    if (isActive())  
    7163    { 
     
    7769void osgAnimation::StatsActionVisitor::apply(StripAnimation& action) 
    7870{ 
    79     _channels.push_back(action.getName()); 
    80     _stats->setAttribute(_frame,action.getName(),0); 
    8171    if (isActive()) 
    8272    { 
  • OpenSceneGraph/trunk/src/osgAnimation/Timeline.cpp

    r10386 r10394  
    162162void osgAnimation::Timeline::addActionNow(Action* action, int priority) 
    163163{ 
    164     addActionAt(getCurrentFrame(), action, priority); 
     164    addActionAt(getCurrentFrame()+1, action, priority); 
    165165} 
    166166