mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Merge branch 'polyobject-plane-stability' into 'next'
Use floating-point math for polyobject planes as well. Closes #581 See merge request STJr/SRB2!1533
This commit is contained in:
commit
113cedd4b6
1 changed files with 5 additions and 3 deletions
|
@ -380,9 +380,11 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
{
|
||||
if (polyobj->angle != 0)
|
||||
{
|
||||
angle_t fineshift = polyobj->angle >> ANGLETOFINESHIFT;
|
||||
xoff -= FixedMul(FINECOSINE(fineshift), polyobj->centerPt.x)+FixedMul(FINESINE(fineshift), polyobj->centerPt.y);
|
||||
yoff -= FixedMul(FINESINE(fineshift), polyobj->centerPt.x)-FixedMul(FINECOSINE(fineshift), polyobj->centerPt.y);
|
||||
float ang = ANG2RAD(polyobj->angle);
|
||||
float x = FixedToFloat(polyobj->centerPt.x);
|
||||
float y = FixedToFloat(polyobj->centerPt.y);
|
||||
xoff -= FloatToFixed(x * cos(ang) + y * sin(ang));
|
||||
yoff -= FloatToFixed(x * sin(ang) - y * cos(ang));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue