Merge branch 'sceneleak' into 'master'

Set paged refs' base node to null (#6335)

Closes #6335

See merge request OpenMW/openmw!3715
qt6_macos
psi29a 5 months ago
commit c3c8fa1e61

@ -102,7 +102,11 @@ namespace MWPhysics
updateScaleUnsafe();
if (!mRotationallyInvariant)
mRotation = mPtr.getRefData().getBaseNode()->getAttitude();
{
const SceneUtil::PositionAttitudeTransform* baseNode = mPtr.getRefData().getBaseNode();
if (baseNode)
mRotation = baseNode->getAttitude();
}
addCollisionMask(getCollisionMask());
updateCollisionObjectPositionUnsafe();

@ -110,6 +110,9 @@ namespace MWPhysics
if (mShapeInstance->mAnimatedShapes.empty())
return false;
if (!mPtr.getRefData().getBaseNode())
return false;
assert(mShapeInstance->mCollisionShape->isCompound());
btCompoundShape* compound = static_cast<btCompoundShape*>(mShapeInstance->mCollisionShape.get());

@ -115,9 +115,7 @@ namespace
if (!refnum.hasContentFile() || !std::binary_search(pagedRefs.begin(), pagedRefs.end(), refnum))
ptr.getClass().insertObjectRendering(ptr, model, rendering);
else
ptr.getRefData().setBaseNode(
new SceneUtil::PositionAttitudeTransform); // FIXME remove this when physics code is fixed not to depend
// on basenode
ptr.getRefData().setBaseNode(nullptr);
setNodeRotation(ptr, rendering, rotation);
if (ptr.getClass().useAnim())

Loading…
Cancel
Save