1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 12:20:41 +00:00

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

This commit is contained in:
Alexei Kotov 2024-01-01 21:55:55 +03:00
parent 78459314bf
commit 2fbdde34c6
3 changed files with 9 additions and 4 deletions

View File

@ -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();

View File

@ -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());

View File

@ -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())