Replaced dynamoc_cast<osg::CullStack*> with asCullStack() to improve performance of AutoTransform, screen size based LOD and PagedLOD.
This commit is contained in:
@@ -140,7 +140,7 @@ osg::Matrixd AutoTransform::computeMatrix(const osg::NodeVisitor* nv) const
|
||||
Quat rotation = _rotation;
|
||||
osg::Vec3d scale = _scale;
|
||||
|
||||
const CullStack* cs = dynamic_cast<const CullStack*>(nv);
|
||||
const CullStack* cs = nv ? nv->asCullStack() : 0;
|
||||
if (cs)
|
||||
{
|
||||
osg::Vec3d eyePoint = cs->getEyeLocal();
|
||||
|
||||
@@ -51,7 +51,7 @@ void LOD::traverse(NodeVisitor& nv)
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::CullStack* cullStack = dynamic_cast<osg::CullStack*>(&nv);
|
||||
osg::CullStack* cullStack = nv.asCullStack();
|
||||
if (cullStack && cullStack->getLODScale())
|
||||
{
|
||||
required_range = cullStack->clampedPixelSize(getBound()) / cullStack->getLODScale();
|
||||
|
||||
@@ -150,7 +150,7 @@ void PagedLOD::traverse(NodeVisitor& nv)
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::CullStack* cullStack = dynamic_cast<osg::CullStack*>(&nv);
|
||||
osg::CullStack* cullStack = nv.asCullStack();
|
||||
if (cullStack && cullStack->getLODScale()>0.0f)
|
||||
{
|
||||
required_range = cullStack->clampedPixelSize(getBound()) / cullStack->getLODScale();
|
||||
|
||||
Reference in New Issue
Block a user