Show
Ignore:
Timestamp:
01/08/09 15:52:11 (5 years ago)
Author:
robert
Message:

From Cedric Pinson, "Here the updated osganimationskinning.cpp that works as before"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osganimationskinning/osganimationskinning.cpp

    r9459 r9474  
    163163 
    164164    osg::ref_ptr<osgAnimation::Skeleton> skelroot = new osgAnimation::Skeleton; 
     165    skelroot->setDefaultUpdateCallback(); 
    165166    osg::ref_ptr<osgAnimation::Bone> root = new osgAnimation::Bone; 
    166167    { 
     
    168169        root->setBindMatrixInBoneSpace(osg::Matrix::translate(-1,0,0)); 
    169170        root->setName("root"); 
     171        root->setDefaultUpdateCallback(); 
    170172    } 
    171173 
     
    173175    right0->setBindMatrixInBoneSpace(osg::Matrix::translate(1,0,0)); 
    174176    right0->setName("right0"); 
     177    right0->setDefaultUpdateCallback("right0"); 
    175178 
    176179    osg::ref_ptr<osgAnimation::Bone> right1 = new osgAnimation::Bone; 
    177180    right1->setBindMatrixInBoneSpace(osg::Matrix::translate(1,0,0)); 
    178181    right1->setName("right1"); 
     182    right1->setDefaultUpdateCallback("right1"); 
    179183 
    180184    root->addChild(right0.get()); 
     
    197201        sampler->setKeyframeContainer(keys0); 
    198202        osgAnimation::AnimationUpdateCallback* cb = dynamic_cast<osgAnimation::AnimationUpdateCallback*>(right0->getUpdateCallback()); 
    199         cb->setName("right0"); 
    200203        osgAnimation::QuatSphericalLinearChannel* channel = new osgAnimation::QuatSphericalLinearChannel(sampler); 
    201204        channel->setName("quaternion"); 
    202205        channel->setTargetName("right0"); 
    203         //cb->link(channel); 
    204206        anim->addChannel(channel); 
    205207    } 
     
    216218        osgAnimation::QuatSphericalLinearChannel* channel = new osgAnimation::QuatSphericalLinearChannel(sampler); 
    217219        osgAnimation::AnimationUpdateCallback* cb = dynamic_cast<osgAnimation::AnimationUpdateCallback*>(right1->getUpdateCallback()); 
    218         cb->setName("right1"); 
    219220        channel->setName("quaternion"); 
    220221        channel->setTargetName("right1"); 
    221         //cb->link(channel); 
    222222        anim->addChannel(channel); 
    223223    } 
     
    238238    trueroot->setMatrix(osg::Matrix(root->getMatrixInBoneSpace().ptr())); 
    239239    trueroot->addChild(createAxis()); 
     240    trueroot->addChild(skelroot); 
    240241    trueroot->setDataVariance(osg::Object::DYNAMIC); 
    241 //    rootTransform->addChild(scene.get()); 
     242    rootTransform->addChild(trueroot); 
    242243    scene->addChild(rootTransform); 
    243 //    manager->addChild(skelroot.get()); 
    244244   
    245245    osgAnimation::RigGeometry* geom = createTesselatedBox(4, 4.0);