mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 07:21:12 +00:00
transformBoundingSphere optimization
This commit is contained in:
parent
a98dc78cc5
commit
15bdb7db01
@ -20,17 +20,18 @@ void transformBoundingSphere (const osg::Matrix& matrix, osg::BoundingSphere& bs
|
|||||||
bsphere._center = bsphere._center*matrix;
|
bsphere._center = bsphere._center*matrix;
|
||||||
|
|
||||||
xdash -= bsphere._center;
|
xdash -= bsphere._center;
|
||||||
osg::BoundingSphere::value_type len_xdash = xdash.length();
|
osg::BoundingSphere::value_type sqrlen_xdash = xdash.length2();
|
||||||
|
|
||||||
ydash -= bsphere._center;
|
ydash -= bsphere._center;
|
||||||
osg::BoundingSphere::value_type len_ydash = ydash.length();
|
osg::BoundingSphere::value_type sqrlen_ydash = ydash.length2();
|
||||||
|
|
||||||
zdash -= bsphere._center;
|
zdash -= bsphere._center;
|
||||||
osg::BoundingSphere::value_type len_zdash = zdash.length();
|
osg::BoundingSphere::value_type sqrlen_zdash = zdash.length2();
|
||||||
|
|
||||||
bsphere._radius = len_xdash;
|
bsphere._radius = sqrlen_xdash;
|
||||||
if (bsphere._radius<len_ydash) bsphere._radius = len_ydash;
|
if (bsphere._radius<sqrlen_ydash) bsphere._radius = sqrlen_ydash;
|
||||||
if (bsphere._radius<len_zdash) bsphere._radius = len_zdash;
|
if (bsphere._radius<sqrlen_zdash) bsphere._radius = sqrlen_zdash;
|
||||||
|
bsphere._radius = sqrtf(bsphere._radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Vec4f colourFromRGB(unsigned int clr)
|
osg::Vec4f colourFromRGB(unsigned int clr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user