mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Make camera follow platform momentum
This commit is contained in:
parent
57022fafe5
commit
85eaf2eeea
3 changed files with 12 additions and 9 deletions
|
|
@ -121,6 +121,7 @@ struct camera_t
|
||||||
|
|
||||||
// Momentums, used to update position.
|
// Momentums, used to update position.
|
||||||
fixed_t momx, momy, momz;
|
fixed_t momx, momy, momz;
|
||||||
|
fixed_t pmomz;
|
||||||
|
|
||||||
// SRB2Kart: camera pans while drifting
|
// SRB2Kart: camera pans while drifting
|
||||||
fixed_t pan;
|
fixed_t pan;
|
||||||
|
|
|
||||||
|
|
@ -3885,10 +3885,10 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||||
thiscam->floorz = tm.floorz;
|
thiscam->floorz = tm.floorz;
|
||||||
thiscam->ceilingz = tm.ceilingz;
|
thiscam->ceilingz = tm.ceilingz;
|
||||||
|
|
||||||
if (thiscam->momz || player->mo->pmomz)
|
if (thiscam->momz || thiscam->pmomz)
|
||||||
{
|
{
|
||||||
// adjust height
|
// adjust height
|
||||||
thiscam->z += thiscam->momz + player->mo->pmomz;
|
thiscam->z += thiscam->momz + thiscam->pmomz;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thiscam->ceilingz - thiscam->z < thiscam->height
|
if (thiscam->ceilingz - thiscam->z < thiscam->height
|
||||||
|
|
|
||||||
16
src/p_user.c
16
src/p_user.c
|
|
@ -2549,9 +2549,6 @@ void P_MovePlayer(player_t *player)
|
||||||
// Look for Quicksand!
|
// Look for Quicksand!
|
||||||
if (CheckForQuicksand)
|
if (CheckForQuicksand)
|
||||||
P_CheckQuicksand(player);
|
P_CheckQuicksand(player);
|
||||||
|
|
||||||
if (P_IsObjectOnGround(player->mo))
|
|
||||||
player->mo->pmomz = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_DoZoomTube(player_t *player)
|
static void P_DoZoomTube(player_t *player)
|
||||||
|
|
@ -4545,9 +4542,6 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
player->mo->flags |= MF_NOGRAVITY;
|
player->mo->flags |= MF_NOGRAVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (P_IsObjectOnGround(player->mo))
|
|
||||||
player->mo->pmomz = 0;
|
|
||||||
|
|
||||||
K_KartPlayerAfterThink(player);
|
K_KartPlayerAfterThink(player);
|
||||||
|
|
||||||
if (player->followmobj && (player->spectator || player->mo->health <= 0 || player->followmobj->type != player->followitem))
|
if (player->followmobj && (player->spectator || player->mo->health <= 0 || player->followmobj->type != player->followitem))
|
||||||
|
|
@ -4598,11 +4592,19 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
player->timeshit = 0;
|
player->timeshit = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (K_PlayerUsesBotMovement(player))
|
if (K_PlayerUsesBotMovement(player))
|
||||||
{
|
{
|
||||||
K_UpdateBotGameplayVars(player);
|
K_UpdateBotGameplayVars(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (thiscam)
|
||||||
|
{
|
||||||
|
// Store before it gets 0'd out
|
||||||
|
thiscam->pmomz = player->mo->pmomz;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (P_IsObjectOnGround(player->mo))
|
||||||
|
player->mo->pmomz = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_SetPlayerAngle(player_t *player, angle_t angle)
|
void P_SetPlayerAngle(player_t *player, angle_t angle)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue