mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 09:09:40 +00:00
Replace a dynamic cast with string comarison
This commit is contained in:
parent
bc4b4c66e4
commit
fc41902798
2 changed files with 12 additions and 3 deletions
|
@ -301,6 +301,8 @@ MWShadowTechnique::ComputeLightSpaceBounds::ComputeLightSpaceBounds(osg::Viewpor
|
|||
pushViewport(viewport);
|
||||
pushProjectionMatrix(new osg::RefMatrix(projectionMatrix));
|
||||
pushModelViewMatrix(new osg::RefMatrix(viewMatrix), osg::Transform::ABSOLUTE_RF);
|
||||
|
||||
setName("SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds,AcceptedByComponentsTerrainQuadTreeWorld");
|
||||
}
|
||||
|
||||
void MWShadowTechnique::ComputeLightSpaceBounds::apply(osg::Node& node)
|
||||
|
|
|
@ -347,9 +347,16 @@ void QuadTreeWorld::accept(osg::NodeVisitor &nv)
|
|||
{
|
||||
if (nv.getVisitorType() != osg::NodeVisitor::CULL_VISITOR && nv.getVisitorType() != osg::NodeVisitor::INTERSECTION_VISITOR)
|
||||
{
|
||||
SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds* shadowBoundsVisitor = dynamic_cast<SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds *>(&nv);
|
||||
if (shadowBoundsVisitor)
|
||||
shadowBoundsVisitor->apply(*this);
|
||||
if (nv.getName().find("AcceptedByComponentsTerrainQuadTreeWorld") != std::string::npos)
|
||||
{
|
||||
if (nv.getName().find("SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds") != std::string::npos)
|
||||
{
|
||||
SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds* clsb = static_cast<SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds*>(&nv);
|
||||
clsb->apply(*this);
|
||||
}
|
||||
else
|
||||
nv.apply(*mRootNode);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue