mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 20:50:58 +00:00
Factor z distance into camera translucency
This commit is contained in:
parent
0f8c736188
commit
2459ca255f
1 changed files with 5 additions and 7 deletions
12
src/p_user.c
12
src/p_user.c
|
@ -10287,19 +10287,17 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
if (!(multiplayer || netgame) && !splitscreen)
|
if (!(multiplayer || netgame) && !splitscreen)
|
||||||
{
|
{
|
||||||
fixed_t vx = thiscam->x, vy = thiscam->y;
|
fixed_t vx = thiscam->x, vy = thiscam->y;
|
||||||
|
fixed_t vz = thiscam->z + thiscam->height / 2;
|
||||||
if (player->awayviewtics && player->awayviewmobj != NULL && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
|
if (player->awayviewtics && player->awayviewmobj != NULL && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
|
||||||
{
|
{
|
||||||
vx = player->awayviewmobj->x;
|
vx = player->awayviewmobj->x;
|
||||||
vy = player->awayviewmobj->y;
|
vy = player->awayviewmobj->y;
|
||||||
|
vz = player->awayviewmobj->z + player->awayviewmobj->height / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* check z distance too for orbital camera */
|
||||||
When the orbital camera looks straight down, its distance
|
if (P_AproxDistance(P_AproxDistance(vx - mo->x, vy - mo->y),
|
||||||
will be very close to the player. So give it a threshold...
|
vz - ( mo->z + mo->height / 2 )) < FixedMul(48*FRACUNIT, mo->scale))
|
||||||
*/
|
|
||||||
if (( !( camorbit && rendermode == render_opengl ) ||
|
|
||||||
focusaiming < ANGLE_90 || focusaiming > ANGLE_292h ) &&
|
|
||||||
P_AproxDistance(vx - mo->x, vy - mo->y) < FixedMul(48*FRACUNIT, mo->scale))
|
|
||||||
mo->flags2 |= MF2_SHADOW;
|
mo->flags2 |= MF2_SHADOW;
|
||||||
else
|
else
|
||||||
mo->flags2 &= ~MF2_SHADOW;
|
mo->flags2 &= ~MF2_SHADOW;
|
||||||
|
|
Loading…
Reference in a new issue