Skip to content

Commit

Permalink
Merge branch 'activewetshoes' into 'master'
Browse files Browse the repository at this point in the history
Preserve node level data variance when merging objects in the active grid

Closes #8231

See merge request OpenMW/openmw!4456
  • Loading branch information
AnyOldName3 committed Nov 18, 2024
2 parents f3e829f + 0a07b1e commit 4a911a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
Bug #8206: Moving away from storm wind origin should make you faster
Bug #8207: Using hand-to-hand while sneaking plays the critical hit sound when the target is not getting hurt
Bug #8208: The launcher's view distance option's minimum value isn't capped to Vanilla's minimum
Bug #8231: AGOP doesn't like NiCollisionSwitch
Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking
Expand Down
13 changes: 10 additions & 3 deletions apps/openmw/mwrender/objectpaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,18 @@ namespace MWRender
{
public:
bool mOptimizeBillboards = true;
bool mActiveGrid = false;
LODRange mDistances = { 0.f, 0.f };
osg::Vec3f mViewVector;
osg::Node::NodeMask mCopyMask = ~0u;
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)
{
const osg::Group* groupToCopy = toCopy->asGroup();
Expand Down Expand Up @@ -203,7 +210,8 @@ namespace MWRender
mNodePath.push_back(node);

osg::Node* cloned = static_cast<osg::Node*>(node->clone(*this));
cloned->setDataVariance(osg::Object::STATIC);
if (!mActiveGrid)
cloned->setDataVariance(osg::Object::STATIC);
cloned->setUserDataContainer(nullptr);
cloned->setName("");

Expand Down Expand Up @@ -720,8 +728,7 @@ namespace MWRender
osg::ref_ptr<osg::Group> mergeGroup = new osg::Group;
osg::ref_ptr<Resource::TemplateMultiRef> templateRefs = new Resource::TemplateMultiRef;
osgUtil::StateToCompile stateToCompile(0, nullptr);
CopyOp copyop;
copyop.mCopyMask = copyMask;
CopyOp copyop(activeGrid, copyMask);
for (const auto& pair : nodes)
{
const osg::Node* cnode = pair.first;
Expand Down

0 comments on commit 4a911a6

Please sign in to comment.