Show
Ignore:
Timestamp:
06/15/09 01:30:47 (8 years ago)
Author:
cedricpinson
Message:

From Cedric Pinson, fix copy constructor for clone operation for Bone, add a missing contructor with quaternion for Target

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgAnimation/Bone.cpp

    r9877 r10343  
    1818 
    1919osgAnimation::Bone::UpdateBone::UpdateBone(const osgAnimation::Bone::UpdateBone& apc,const osg::CopyOp& copyop) : 
    20     osgAnimation::AnimationUpdateCallback(apc, copyop), 
    21     _position(apc._position), 
    22     _quaternion(apc._quaternion), 
    23     _scale(apc._scale) 
     20    osgAnimation::AnimationUpdateCallback(apc, copyop) 
    2421{ 
     22    _quaternion = new osgAnimation::QuatTarget(apc._quaternion->getValue()); 
     23    _position = new osgAnimation::Vec3Target(apc._position->getValue()); 
     24    _scale = new osgAnimation::Vec3Target(apc._scale->getValue()); 
    2525} 
    2626 
     
    3131    _rotation(b._rotation), 
    3232    _scale(b._scale), 
     33    _bindInBoneSpace(b._bindInBoneSpace), 
     34    _invBindInSkeletonSpace(b._invBindInSkeletonSpace), 
     35    _boneInSkeletonSpace(b._boneInSkeletonSpace), 
    3336    _needToRecomputeBindMatrix(true) 
    3437{ 
     38    osg::ref_ptr<osg::NodeCallback> updatecallback = getUpdateCallback(); 
     39    setUpdateCallback(0); 
     40    while (updatecallback.valid()) { 
     41        osg::NodeCallback* ucb = dynamic_cast<osg::NodeCallback*>(updatecallback->clone(copyop)); 
     42        ucb->setNestedCallback(0); 
     43        ucb->setName(updatecallback->getName()); 
     44        addUpdateCallback(ucb); 
     45        updatecallback = updatecallback->getNestedCallback(); 
     46    } 
    3547} 
    3648