From 15bdb7db01b58bea6ad20048eb45838c107b71b8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 30 Apr 2015 17:17:13 +0200 Subject: [PATCH] transformBoundingSphere optimization --- components/sceneutil/util.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/sceneutil/util.cpp b/components/sceneutil/util.cpp index a41c6b74b..52f9c9e54 100644 --- a/components/sceneutil/util.cpp +++ b/components/sceneutil/util.cpp @@ -20,17 +20,18 @@ void transformBoundingSphere (const osg::Matrix& matrix, osg::BoundingSphere& bs bsphere._center = bsphere._center*matrix; xdash -= bsphere._center; - osg::BoundingSphere::value_type len_xdash = xdash.length(); + osg::BoundingSphere::value_type sqrlen_xdash = xdash.length2(); ydash -= bsphere._center; - osg::BoundingSphere::value_type len_ydash = ydash.length(); + osg::BoundingSphere::value_type sqrlen_ydash = ydash.length2(); zdash -= bsphere._center; - osg::BoundingSphere::value_type len_zdash = zdash.length(); + osg::BoundingSphere::value_type sqrlen_zdash = zdash.length2(); - bsphere._radius = len_xdash; - if (bsphere._radius