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

@ -303,10 +303,7 @@ int CNpcBranchPlatform::getHeightFromPlatformAtPosition(int _x,int _y, int offse
top.vx = offsetX + collisionArea.x1; top.vx = offsetX + collisionArea.x1;
} }
//sBBox boundingBox = m_modelGfx->GetBBox(); top.vy = offsetY + collisionArea.y1;
sBBox boundingBox = getBBox();
//top.vy = collisionArea.y1;
top.vy = boundingBox.YMin + Pos.vy + offsetY;
angle=getCollisionAngle(); angle=getCollisionAngle();
if(angle==0) if(angle==0)
@ -317,7 +314,6 @@ int CNpcBranchPlatform::getHeightFromPlatformAtPosition(int _x,int _y, int offse
else else
{ {
// Rotate backwards to find height at current position // 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 ); int hypotenuse = ( ( top.vx - _x ) << 12 ) / rcos( angle );

View file

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