1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-07 15:00:57 +00:00

Merge branch 'rotatingtouhouplush' into 'master'

Use horizontal extent ratio to detect stretched bounding boxes (#8847)

Closes #8847

See merge request OpenMW/openmw!5052
This commit is contained in:
Alexei Kotov 2025-12-19 04:26:35 +03:00
commit bca843fd23

View file

@ -63,8 +63,11 @@ namespace MWPhysics
}
const btVector3 halfExtents = Misc::Convert::toBullet(mOriginalHalfExtents);
if ((mMeshTranslation.x() == 0.0 && mMeshTranslation.y() == 0.0)
&& std::fabs(mOriginalHalfExtents.x() - mOriginalHalfExtents.y()) < 2.2)
float extRatio = 0.f;
if (mOriginalHalfExtents.y() != 0.f)
extRatio = mOriginalHalfExtents.x() / mOriginalHalfExtents.y();
if (mMeshTranslation.x() == 0.0 && mMeshTranslation.y() == 0.0 && extRatio >= 1.f / 1.1f && extRatio <= 1.1f)
{
switch (collisionShapeType)
{