This commit is contained in:
Charles 2001-05-21 21:57:28 +00:00
parent 71e090e2c8
commit e114d0269c
2 changed files with 12 additions and 10 deletions

View file

@ -1075,23 +1075,29 @@ int CNpcPlatform::getHeightFromPlatformAtPosition(int _x,int _y, int offsetX, in
int angle;
CRECT collisionArea = getCollisionArea();
top.vx = offsetX + ( ( collisionArea.x1 + collisionArea.x2 ) >> 1 );
//sBBox boundingBox = m_modelGfx->GetBBox();
sBBox boundingBox = getBBox();
//top.vy = collisionArea.y1;
top.vy = boundingBox.YMin + Pos.vy + offsetY;
top.vy = offsetY + collisionArea.y1;
angle=getCollisionAngle();
if(angle==0)
{
// Non-rotated platform
return( top.vy - _y );
}
else
{
if ( angle > 0 )
{
top.vx = offsetX + collisionArea.x1;
}
else
{
top.vx = offsetX + collisionArea.x2;
}
// Rotate backwards to find height at current position
//return( ( top.vy - _y ) + ( ( top.vx - _x ) * msin( -angle & 4095 ) >> 12 ) );
int hypotenuse = ( ( top.vx - _x ) << 12 ) / rcos( angle );