- Timestamp:
- 01/08/09 15:52:11 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osganimationskinning/osganimationskinning.cpp
r9459 r9474 163 163 164 164 osg::ref_ptr<osgAnimation::Skeleton> skelroot = new osgAnimation::Skeleton; 165 skelroot->setDefaultUpdateCallback(); 165 166 osg::ref_ptr<osgAnimation::Bone> root = new osgAnimation::Bone; 166 167 { … … 168 169 root->setBindMatrixInBoneSpace(osg::Matrix::translate(-1,0,0)); 169 170 root->setName("root"); 171 root->setDefaultUpdateCallback(); 170 172 } 171 173 … … 173 175 right0->setBindMatrixInBoneSpace(osg::Matrix::translate(1,0,0)); 174 176 right0->setName("right0"); 177 right0->setDefaultUpdateCallback("right0"); 175 178 176 179 osg::ref_ptr<osgAnimation::Bone> right1 = new osgAnimation::Bone; 177 180 right1->setBindMatrixInBoneSpace(osg::Matrix::translate(1,0,0)); 178 181 right1->setName("right1"); 182 right1->setDefaultUpdateCallback("right1"); 179 183 180 184 root->addChild(right0.get()); … … 197 201 sampler->setKeyframeContainer(keys0); 198 202 osgAnimation::AnimationUpdateCallback* cb = dynamic_cast<osgAnimation::AnimationUpdateCallback*>(right0->getUpdateCallback()); 199 cb->setName("right0");200 203 osgAnimation::QuatSphericalLinearChannel* channel = new osgAnimation::QuatSphericalLinearChannel(sampler); 201 204 channel->setName("quaternion"); 202 205 channel->setTargetName("right0"); 203 //cb->link(channel);204 206 anim->addChannel(channel); 205 207 } … … 216 218 osgAnimation::QuatSphericalLinearChannel* channel = new osgAnimation::QuatSphericalLinearChannel(sampler); 217 219 osgAnimation::AnimationUpdateCallback* cb = dynamic_cast<osgAnimation::AnimationUpdateCallback*>(right1->getUpdateCallback()); 218 cb->setName("right1");219 220 channel->setName("quaternion"); 220 221 channel->setTargetName("right1"); 221 //cb->link(channel);222 222 anim->addChannel(channel); 223 223 } … … 238 238 trueroot->setMatrix(osg::Matrix(root->getMatrixInBoneSpace().ptr())); 239 239 trueroot->addChild(createAxis()); 240 trueroot->addChild(skelroot); 240 241 trueroot->setDataVariance(osg::Object::DYNAMIC); 241 // rootTransform->addChild(scene.get());242 rootTransform->addChild(trueroot); 242 243 scene->addChild(rootTransform); 243 // manager->addChild(skelroot.get());244 244 245 245 osgAnimation::RigGeometry* geom = createTesselatedBox(4, 4.0);
