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:
commit
bca843fd23
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue