1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Apply ShaderVisitor to Rig/MorphGeometry source geometry

This commit is contained in:
Alexei Dobrohotov 2023-03-01 18:27:44 +03:00
parent 6aef366fd3
commit 471f6abf6c

View File

@ -889,21 +889,28 @@ namespace Shader
if (auto rig = dynamic_cast<SceneUtil::RigGeometry*>(&drawable))
{
osg::ref_ptr<osg::Geometry> sourceGeometry = rig->getSourceGeometry();
if (sourceGeometry && adjustGeometry(*sourceGeometry, reqs))
if (sourceGeometry)
{
sourceGeometry->accept(*this);
rig->setSourceGeometry(sourceGeometry);
}
}
else if (auto morph = dynamic_cast<SceneUtil::MorphGeometry*>(&drawable))
{
osg::ref_ptr<osg::Geometry> sourceGeometry = morph->getSourceGeometry();
if (sourceGeometry && adjustGeometry(*sourceGeometry, reqs))
if (sourceGeometry)
{
sourceGeometry->accept(*this);
morph->setSourceGeometry(sourceGeometry);
}
}
else if (auto osgaRig = dynamic_cast<SceneUtil::RigGeometryHolder*>(&drawable))
{
osg::ref_ptr<SceneUtil::OsgaRigGeometry> sourceOsgaRigGeometry = osgaRig->getSourceRigGeometry();
osg::ref_ptr<osg::Geometry> sourceGeometry = sourceOsgaRigGeometry->getSourceGeometry();
if (sourceGeometry && adjustGeometry(*sourceGeometry, reqs))
if (sourceGeometry)
{
sourceGeometry->accept(*this);
sourceOsgaRigGeometry->setSourceGeometry(sourceGeometry);
osgaRig->setSourceRigGeometry(sourceOsgaRigGeometry);
}