mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
First person view now should correctly take the skybox centerpoint's angle into account
This commit is contained in:
parent
e769b7882c
commit
099e25824f
1 changed files with 32 additions and 4 deletions
36
src/r_main.c
36
src/r_main.c
|
@ -972,14 +972,42 @@ void R_SkyboxFrame(player_t *player)
|
|||
{
|
||||
if (skyboxmo[1])
|
||||
{
|
||||
fixed_t x = 0, y = 0;
|
||||
if (mh->skybox_scalex > 0)
|
||||
viewx += (player->mo->x - skyboxmo[1]->x) / mh->skybox_scalex;
|
||||
x = (player->mo->x - skyboxmo[1]->x) / mh->skybox_scalex;
|
||||
else if (mh->skybox_scalex < 0)
|
||||
viewx += (player->mo->x - skyboxmo[1]->x) * -mh->skybox_scalex;
|
||||
x = (player->mo->x - skyboxmo[1]->x) * -mh->skybox_scalex;
|
||||
if (mh->skybox_scaley > 0)
|
||||
viewy += (player->mo->y - skyboxmo[1]->y) / mh->skybox_scaley;
|
||||
y = (player->mo->y - skyboxmo[1]->y) / mh->skybox_scaley;
|
||||
else if (mh->skybox_scaley < 0)
|
||||
viewy += (player->mo->y - skyboxmo[1]->y) * -mh->skybox_scaley;
|
||||
y = (player->mo->y - skyboxmo[1]->y) * -mh->skybox_scaley;
|
||||
|
||||
if (viewmobj->angle == 0)
|
||||
{
|
||||
viewx += x;
|
||||
viewy += y;
|
||||
}
|
||||
else if (viewmobj->angle == ANGLE_90)
|
||||
{
|
||||
viewx -= y;
|
||||
viewy += x;
|
||||
}
|
||||
else if (viewmobj->angle == ANGLE_180)
|
||||
{
|
||||
viewx -= x;
|
||||
viewy -= y;
|
||||
}
|
||||
else if (viewmobj->angle == ANGLE_270)
|
||||
{
|
||||
viewx += y;
|
||||
viewy -= x;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle_t ang = viewmobj->angle>>ANGLETOFINESHIFT;
|
||||
viewx += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang));
|
||||
viewy += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang));
|
||||
}
|
||||
}
|
||||
if (mh->skybox_scalez > 0)
|
||||
viewz += player->viewz / mh->skybox_scalez;
|
||||
|
|
Loading…
Reference in a new issue