mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 01:01:45 +00:00
Use floating point trigonometry
This commit is contained in:
parent
7500d12eeb
commit
5b86b8991c
1 changed files with 5 additions and 5 deletions
|
@ -368,11 +368,11 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
if (plangle != 0)
|
||||
{
|
||||
// Add the view offset, rotated by the plane angle.
|
||||
fixed_t cosinecomponent = FINECOSINE(plangle>>ANGLETOFINESHIFT);
|
||||
fixed_t sinecomponent = FINESINE(plangle>>ANGLETOFINESHIFT);
|
||||
fixed_t oldxoff = xoff;
|
||||
xoff = FixedMul(xoff,cosinecomponent)+FixedMul(yoff,sinecomponent);
|
||||
yoff = -FixedMul(oldxoff,sinecomponent)+FixedMul(yoff,cosinecomponent);
|
||||
float ang = ANG2RAD(plangle);
|
||||
float x = FixedToFloat(xoff);
|
||||
float y = FixedToFloat(yoff);
|
||||
xoff = FloatToFixed(x * cos(ang) + y * sin(ang));
|
||||
yoff = FloatToFixed(-x * sin(ang) + y * cos(ang));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue