From 8f0322d9d1d77551254edd918f82d2f3a2246517 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 21 Aug 2009 10:18:46 +0000 Subject: [PATCH] Fixed handling of double precision bounding sphere type. --- src/osgPresentation/SlideShowConstructor.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/osgPresentation/SlideShowConstructor.cpp b/src/osgPresentation/SlideShowConstructor.cpp index d48cf6c2b..8f3929d1d 100644 --- a/src/osgPresentation/SlideShowConstructor.cpp +++ b/src/osgPresentation/SlideShowConstructor.cpp @@ -868,7 +868,9 @@ void SlideShowConstructor::addImage(const std::string& filename, const PositionD { osg::notify(osg::INFO)<<"Have animation path for image"<getBound().center(); + osg::BoundingSphere::vec_type pivot = positionData.absolute_path ? + osg::BoundingSphere::vec_type(0.0f,0.0f,0.0f) : + subgraph->getBound().center(); osg::PositionAttitudeTransform* animation_transform = new osg::PositionAttitudeTransform; animation_transform->setDataVariance(osg::Object::DYNAMIC); @@ -1029,7 +1031,9 @@ void SlideShowConstructor::addStereoImagePair(const std::string& filenameLeft, c { osg::notify(osg::INFO)<<"Have animation path for image"<getBound().center(); + osg::BoundingSphere::vec_type pivot = positionData.absolute_path ? + osg::BoundingSphere::vec_type(0.0f,0.0f,0.0f) : + subgraph->getBound().center(); osg::PositionAttitudeTransform* animation_transform = new osg::PositionAttitudeTransform; animation_transform->setDataVariance(osg::Object::DYNAMIC); @@ -1167,7 +1171,9 @@ osg::Image* SlideShowConstructor::addInteractiveImage(const std::string& filenam { osg::notify(osg::INFO)<<"Have animation path for image"<getBound().center(); + osg::BoundingSphere::vec_type pivot = positionData.absolute_path ? + osg::BoundingSphere::vec_type(0.0f,0.0f,0.0f) : + subgraph->getBound().center(); osg::PositionAttitudeTransform* animation_transform = new osg::PositionAttitudeTransform; animation_transform->setDataVariance(osg::Object::DYNAMIC); @@ -1351,7 +1357,9 @@ void SlideShowConstructor::addModel(osg::Node* subgraph, const PositionData& pos { osg::notify(osg::INFO)<<"Have animation path for model"<getBound().center(); + osg::BoundingSphere::vec_type pivot = positionData.absolute_path ? + osg::BoundingSphere::vec_type(0.0f,0.0f,0.0f) : + subgraph->getBound().center(); osg::AnimationPath* path = animation->getAnimationPath(); if (positionData.animation_name=="wheel" && (path->getTimeControlPointMap()).size()>=2)