|
|
@ -133,11 +133,18 @@ namespace MWRender
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
bool mOptimizeBillboards = true;
|
|
|
|
bool mOptimizeBillboards = true;
|
|
|
|
|
|
|
|
bool mActiveGrid = false;
|
|
|
|
LODRange mDistances = { 0.f, 0.f };
|
|
|
|
LODRange mDistances = { 0.f, 0.f };
|
|
|
|
osg::Vec3f mViewVector;
|
|
|
|
osg::Vec3f mViewVector;
|
|
|
|
osg::Node::NodeMask mCopyMask = ~0u;
|
|
|
|
osg::Node::NodeMask mCopyMask = ~0u;
|
|
|
|
mutable std::vector<const osg::Node*> mNodePath;
|
|
|
|
mutable std::vector<const osg::Node*> mNodePath;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CopyOp(bool activeGrid, osg::Node::NodeMask copyMask)
|
|
|
|
|
|
|
|
: mActiveGrid(activeGrid)
|
|
|
|
|
|
|
|
, mCopyMask(copyMask)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void copy(const osg::Node* toCopy, osg::Group* attachTo)
|
|
|
|
void copy(const osg::Node* toCopy, osg::Group* attachTo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const osg::Group* groupToCopy = toCopy->asGroup();
|
|
|
|
const osg::Group* groupToCopy = toCopy->asGroup();
|
|
|
@ -203,6 +210,7 @@ namespace MWRender
|
|
|
|
mNodePath.push_back(node);
|
|
|
|
mNodePath.push_back(node);
|
|
|
|
|
|
|
|
|
|
|
|
osg::Node* cloned = static_cast<osg::Node*>(node->clone(*this));
|
|
|
|
osg::Node* cloned = static_cast<osg::Node*>(node->clone(*this));
|
|
|
|
|
|
|
|
if (!mActiveGrid)
|
|
|
|
cloned->setDataVariance(osg::Object::STATIC);
|
|
|
|
cloned->setDataVariance(osg::Object::STATIC);
|
|
|
|
cloned->setUserDataContainer(nullptr);
|
|
|
|
cloned->setUserDataContainer(nullptr);
|
|
|
|
cloned->setName("");
|
|
|
|
cloned->setName("");
|
|
|
@ -720,8 +728,7 @@ namespace MWRender
|
|
|
|
osg::ref_ptr<osg::Group> mergeGroup = new osg::Group;
|
|
|
|
osg::ref_ptr<osg::Group> mergeGroup = new osg::Group;
|
|
|
|
osg::ref_ptr<Resource::TemplateMultiRef> templateRefs = new Resource::TemplateMultiRef;
|
|
|
|
osg::ref_ptr<Resource::TemplateMultiRef> templateRefs = new Resource::TemplateMultiRef;
|
|
|
|
osgUtil::StateToCompile stateToCompile(0, nullptr);
|
|
|
|
osgUtil::StateToCompile stateToCompile(0, nullptr);
|
|
|
|
CopyOp copyop;
|
|
|
|
CopyOp copyop(activeGrid, copyMask);
|
|
|
|
copyop.mCopyMask = copyMask;
|
|
|
|
|
|
|
|
for (const auto& pair : nodes)
|
|
|
|
for (const auto& pair : nodes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const osg::Node* cnode = pair.first;
|
|
|
|
const osg::Node* cnode = pair.first;
|
|
|
|