diff --git a/source/platform/pbranch.cpp b/source/platform/pbranch.cpp index 431f03afb..96f3b0c1d 100644 --- a/source/platform/pbranch.cpp +++ b/source/platform/pbranch.cpp @@ -39,7 +39,6 @@ void CNpcBranchPlatform::postInit() CNpcPlatform::postInit(); m_angularVelocity = 0; - m_platformWidth <<= 1; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 844b9f115..c407d4632 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -665,18 +665,21 @@ void CNpcPlatform::calculateBoundingBoxSize() angle=getCollisionAngle(); centre=getCollisionCentre(); - halfLength=m_platformWidth/2; - /*x1=-halfLength*mcos(angle&4095)>>12; + //halfLength=m_platformWidth/2; + sBBox boundingBox = m_modelGfx->GetBBox(); + halfLength = ( boundingBox.XMax - boundingBox.XMin ) >> 1; + + x1=-halfLength*mcos(angle&4095)>>12; y1=-halfLength*msin(angle&4095)>>12; x2=+halfLength*mcos(angle&4095)>>12; y2=+halfLength*msin(angle&4095)>>12; - setCollisionSize(abs(x2-x1),abs(y2-y1)+PLATFORMCOLLISIONHEIGHT);*/ + setCollisionSize(abs(x2-x1),abs(y2-y1)+PLATFORMCOLLISIONHEIGHT); - sBBox boundingBox = m_modelGfx->GetBBox(); - setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) ); - setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 ); + //sBBox boundingBox = m_modelGfx->GetBBox(); + //setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) ); + //setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 ); } diff --git a/source/platform/platform.h b/source/platform/platform.h index 4c0b53e9e..b83329dba 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -205,8 +205,6 @@ protected: CModelGfx *m_modelGfx; u8 m_isShuttingDown; - u8 m_platformWidth; - int m_graphicNum; virtual void collidedWith(CThing *_thisThing);