This commit is contained in:
parent
f23d98b2bf
commit
f8f075c3d4
1 changed files with 12 additions and 5 deletions
|
@ -1200,13 +1200,20 @@ void CNpcPlatform::setTiltable( bool isTiltable )
|
||||||
int CNpcPlatform::getHeightFromPlatformAtPosition(int _x,int _y)
|
int CNpcPlatform::getHeightFromPlatformAtPosition(int _x,int _y)
|
||||||
{
|
{
|
||||||
DVECTOR centre;
|
DVECTOR centre;
|
||||||
int y;
|
int angle;
|
||||||
|
|
||||||
// Rotate backwards to find height at current position
|
|
||||||
centre=getCollisionCentre();
|
centre=getCollisionCentre();
|
||||||
y=(centre.vx-_x)*msin(-getCollisionAngle()&4095)>>12;
|
angle=getCollisionAngle();
|
||||||
|
if(angle==0)
|
||||||
return (centre.vy-_y)+y;
|
{
|
||||||
|
// Non-rotated platform
|
||||||
|
return centre.vy-_y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Rotate backwards to find height at current position
|
||||||
|
return (centre.vy-_y)+((centre.vx-_x)*msin(-angle&4095)>>12);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Reference in a new issue