From 63cdbd8714a0b3b1424a2a0f848d3db692c09dcf Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 23 Mar 2009 16:07:43 +0000 Subject: [PATCH] From Roland Smeenk, "Here's a small simplification of the osganimationmorph example. Only one morphtarget needs to be added to the MorphGeometry since it already has a base geometry. The animation will morph between the base geometry and the first target. " --- examples/osganimationmorph/osganimationmorph.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/examples/osganimationmorph/osganimationmorph.cpp b/examples/osganimationmorph/osganimationmorph.cpp index 6eaf3f664..81a437f38 100644 --- a/examples/osganimationmorph/osganimationmorph.cpp +++ b/examples/osganimationmorph/osganimationmorph.cpp @@ -62,7 +62,6 @@ int main (int argc, char* argv[]) osg::ArgumentParser arguments(&argc, argv); osgViewer::Viewer viewer(arguments); - osgAnimation::Animation* animation = new osgAnimation::Animation; osgAnimation::FloatLinearChannel* channel0 = new osgAnimation::FloatLinearChannel; channel0->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::FloatKeyframe(0,0.0)); @@ -70,14 +69,7 @@ int main (int argc, char* argv[]) channel0->setTargetName("MorphNodeCallback"); channel0->setName("0"); - osgAnimation::FloatLinearChannel* channel1 = new osgAnimation::FloatLinearChannel; - channel1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::FloatKeyframe(0,1.0)); - channel1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::FloatKeyframe(1,0.0)); - channel1->setTargetName("MorphNodeCallback"); - channel1->setName("1"); - animation->addChannel(channel0); - animation->addChannel(channel1); animation->setName("Morph"); animation->computeDuration(); animation->setPlaymode(osgAnimation::Animation::PPONG); @@ -98,7 +90,6 @@ int main (int argc, char* argv[]) // initialize with the first shape osgAnimation::MorphGeometry* morph = new osgAnimation::MorphGeometry(*geom0); - morph->addMorphTarget(geom0); morph->addMorphTarget(geom1); viewer.setCameraManipulator(new osgGA::TrackballManipulator());