mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 17:15:39 +00:00
Calculate bounding volumes when preloading model instance
This commit is contained in:
parent
c20e69ef24
commit
b214c54b3a
1 changed files with 8 additions and 0 deletions
|
@ -531,6 +531,8 @@ namespace Resource
|
||||||
|
|
||||||
if (mIncrementalCompileOperation)
|
if (mIncrementalCompileOperation)
|
||||||
mIncrementalCompileOperation->add(loaded);
|
mIncrementalCompileOperation->add(loaded);
|
||||||
|
else
|
||||||
|
loaded->getBound();
|
||||||
|
|
||||||
mCache->addEntryToObjectCache(normalized, loaded);
|
mCache->addEntryToObjectCache(normalized, loaded);
|
||||||
return loaded;
|
return loaded;
|
||||||
|
@ -543,6 +545,12 @@ namespace Resource
|
||||||
mVFS->normalizeFilename(normalized);
|
mVFS->normalizeFilename(normalized);
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> node = createInstance(normalized);
|
osg::ref_ptr<osg::Node> node = createInstance(normalized);
|
||||||
|
|
||||||
|
// Note: osg::clone() does not calculate bound volumes.
|
||||||
|
// Do it immediately, otherwise we will need to update them for all objects
|
||||||
|
// during first update traversal, what may lead to stuttering during cell transitions
|
||||||
|
node->getBound();
|
||||||
|
|
||||||
mInstanceCache->addEntryToObjectCache(normalized, node.get());
|
mInstanceCache->addEntryToObjectCache(normalized, node.get());
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue