mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Merge branch 'NiFltAnimationNode' into 'master'
Add NiFltAnimationNode support Closes #6684 See merge request OpenMW/openmw!1732
This commit is contained in:
commit
1ac7eaa6b0
9 changed files with 91 additions and 6 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <osg/MatrixTransform>
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
#include <osg/LOD>
|
||||
#include <osg/Sequence>
|
||||
#include <osg/Billboard>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Notify>
|
||||
|
@ -845,7 +846,7 @@ void Optimizer::RemoveEmptyNodesVisitor::removeEmptyNodes()
|
|||
++pitr)
|
||||
{
|
||||
osg::Group* parent = *pitr;
|
||||
if (!parent->asSwitch() && !dynamic_cast<osg::LOD*>(parent))
|
||||
if (!parent->asSwitch() && !dynamic_cast<osg::LOD*>(parent) && !dynamic_cast<osg::Sequence*>(parent))
|
||||
{
|
||||
parent->removeChild(nodeToRemove.get());
|
||||
if (parent->getNumChildren()==0 && isOperationPermissibleForObject(parent)) newEmptyGroups.insert(parent);
|
||||
|
@ -887,6 +888,13 @@ void Optimizer::RemoveRedundantNodesVisitor::apply(osg::Switch& switchNode)
|
|||
traverse(*switchNode.getChild(i));
|
||||
}
|
||||
|
||||
void Optimizer::RemoveRedundantNodesVisitor::apply(osg::Sequence& sequenceNode)
|
||||
{
|
||||
// We should keep all sequence child nodes since they reflect different sequence states.
|
||||
for (unsigned int i=0; i<sequenceNode.getNumChildren(); ++i)
|
||||
traverse(*sequenceNode.getChild(i));
|
||||
}
|
||||
|
||||
void Optimizer::RemoveRedundantNodesVisitor::apply(osg::Group& group)
|
||||
{
|
||||
if (typeid(group)==typeid(osg::Group) &&
|
||||
|
@ -1951,6 +1959,12 @@ void Optimizer::MergeGroupsVisitor::apply(osg::Switch &switchNode)
|
|||
traverse(switchNode);
|
||||
}
|
||||
|
||||
void Optimizer::MergeGroupsVisitor::apply(osg::Sequence &sequenceNode)
|
||||
{
|
||||
// We should keep all sequence child nodes since they reflect different sequence states.
|
||||
traverse(sequenceNode);
|
||||
}
|
||||
|
||||
void Optimizer::MergeGroupsVisitor::apply(osg::Group &group)
|
||||
{
|
||||
if (group.getNumChildren() <= 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue