From Cedric Pinson, this commit contains the following change:
* Change ref_ptr to observer_ptr to avoid cross reference and leak in Skinning * Set invalidate to true to re run the check visitor in Skeleton * Shallow copy Sampler in channel copy constructor * Add accessor in VertexInfluence * Remove dead code in Timeline.cpp * Dont force linking in Bone::UpdateBone, the decision is done by the user or the manager * Add offset in timeline stats to display each manager on the screen * Add a flag in animation manager base to enable or not automatic link when modifying the manager
This commit is contained in:
@@ -23,6 +23,7 @@ AnimationManagerBase::~AnimationManagerBase() {}
|
||||
AnimationManagerBase::AnimationManagerBase()
|
||||
{
|
||||
_needToLink = false;
|
||||
_automaticLink = true;
|
||||
}
|
||||
|
||||
void AnimationManagerBase::clearTargets()
|
||||
@@ -31,6 +32,14 @@ void AnimationManagerBase::clearTargets()
|
||||
(*it).get()->reset();
|
||||
}
|
||||
|
||||
void AnimationManagerBase::dirty()
|
||||
{
|
||||
_needToLink = true;
|
||||
}
|
||||
|
||||
void AnimationManagerBase::setAutomaticLink(bool state) { _automaticLink = state; }
|
||||
bool AnimationManagerBase::isAutomaticLink() const { return _automaticLink; }
|
||||
|
||||
void AnimationManagerBase::operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
||||
@@ -64,13 +73,14 @@ AnimationManagerBase::AnimationManagerBase(const AnimationManagerBase& b, const
|
||||
_animations.push_back(animation);
|
||||
}
|
||||
_needToLink = true;
|
||||
_automaticLink = b._automaticLink;
|
||||
buildTargetReference();
|
||||
}
|
||||
|
||||
void AnimationManagerBase::buildTargetReference()
|
||||
{
|
||||
_targets.clear();
|
||||
for( AnimationList::iterator iterAnim = _animations.begin(); iterAnim != _animations.end(); ++iterAnim )
|
||||
for( AnimationList::iterator iterAnim = _animations.begin(); iterAnim != _animations.end(); ++iterAnim )
|
||||
{
|
||||
Animation* anim = (*iterAnim).get();
|
||||
for (ChannelList::iterator it = anim->getChannels().begin();
|
||||
@@ -98,7 +108,7 @@ void AnimationManagerBase::unregisterAnimation (Animation* animation)
|
||||
buildTargetReference();
|
||||
}
|
||||
|
||||
bool AnimationManagerBase::needToLink() const { return _needToLink; }
|
||||
bool AnimationManagerBase::needToLink() const { return _needToLink && isAutomaticLink(); }
|
||||
|
||||
|
||||
void AnimationManagerBase::setLinkVisitor(LinkVisitor* visitor)
|
||||
|
||||
Reference in New Issue
Block a user