Skip to content

Commit bca843f

Browse files
committed
Merge branch 'rotatingtouhouplush' into 'master'
Use horizontal extent ratio to detect stretched bounding boxes (#8847) Closes #8847 See merge request OpenMW/openmw!5052
2 parents f9bc769 + f83a09b commit bca843f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/openmw/mwphysics/actor.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ namespace MWPhysics
6363
}
6464

6565
const btVector3 halfExtents = Misc::Convert::toBullet(mOriginalHalfExtents);
66-
if ((mMeshTranslation.x() == 0.0 && mMeshTranslation.y() == 0.0)
67-
&& std::fabs(mOriginalHalfExtents.x() - mOriginalHalfExtents.y()) < 2.2)
66+
float extRatio = 0.f;
67+
if (mOriginalHalfExtents.y() != 0.f)
68+
extRatio = mOriginalHalfExtents.x() / mOriginalHalfExtents.y();
69+
70+
if (mMeshTranslation.x() == 0.0 && mMeshTranslation.y() == 0.0 && extRatio >= 1.f / 1.1f && extRatio <= 1.1f)
6871
{
6972
switch (collisionShapeType)
7073
{

0 commit comments

Comments
 (0)