From 4b769494cbfd889fd16a0cef3eeb17b7dd1b2812 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 1 Jun 2009 11:08:34 +0000 Subject: [PATCH] From Emmanuel Roche, "I've also updated the computeBound() method from the osg::Transform class : this method was using float based temporary variables and thus the double precision is lost here. I've changed that to use the generic types osg::BoundingSphere::vec_type and osg::BoundingSphere::value_type instead." --- src/osg/Transform.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/osg/Transform.cpp b/src/osg/Transform.cpp index c5040b601..fe5e06344 100644 --- a/src/osg/Transform.cpp +++ b/src/osg/Transform.cpp @@ -163,29 +163,28 @@ BoundingSphere Transform::computeBound() const computeLocalToWorldMatrix(l2w,NULL); - Vec3 xdash = bsphere._center; + osg::BoundingSphere::vec_type xdash = bsphere._center; xdash.x() += bsphere._radius; xdash = xdash*l2w; - Vec3 ydash = bsphere._center; + osg::BoundingSphere::vec_type ydash = bsphere._center; ydash.y() += bsphere._radius; ydash = ydash*l2w; - Vec3 zdash = bsphere._center; + osg::BoundingSphere::vec_type zdash = bsphere._center; zdash.z() += bsphere._radius; zdash = zdash*l2w; - bsphere._center = bsphere._center*l2w; xdash -= bsphere._center; - float len_xdash = xdash.length(); + osg::BoundingSphere::value_type len_xdash = xdash.length(); ydash -= bsphere._center; - float len_ydash = ydash.length(); + osg::BoundingSphere::value_type len_ydash = ydash.length(); zdash -= bsphere._center; - float len_zdash = zdash.length(); + osg::BoundingSphere::value_type len_zdash = zdash.length(); bsphere._radius = len_xdash; if (bsphere._radius