mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 06:53:40 +00:00
Fixed weapon bob jittering.
This commit is contained in:
parent
38d29c235b
commit
0aefc61f86
3 changed files with 6 additions and 3 deletions
|
@ -310,6 +310,7 @@ public:
|
||||||
double viewz = 0; // focal origin above r.z
|
double viewz = 0; // focal origin above r.z
|
||||||
double viewheight = 0; // base height above floor for viewz
|
double viewheight = 0; // base height above floor for viewz
|
||||||
double deltaviewheight = 0; // squat speed.
|
double deltaviewheight = 0; // squat speed.
|
||||||
|
float prevbob = 0; // Previous value of "bob"
|
||||||
double bob = 0; // bounded/scaled total velocity
|
double bob = 0; // bounded/scaled total velocity
|
||||||
|
|
||||||
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
|
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
|
||||||
|
|
|
@ -275,6 +275,7 @@ void player_t::CopyFrom(player_t &p, bool copyPSP)
|
||||||
viewz = p.viewz;
|
viewz = p.viewz;
|
||||||
viewheight = p.viewheight;
|
viewheight = p.viewheight;
|
||||||
deltaviewheight = p.deltaviewheight;
|
deltaviewheight = p.deltaviewheight;
|
||||||
|
prevbob = p.prevbob;
|
||||||
bob = p.bob;
|
bob = p.bob;
|
||||||
Vel = p.Vel;
|
Vel = p.Vel;
|
||||||
centering = p.centering;
|
centering = p.centering;
|
||||||
|
@ -1264,6 +1265,7 @@ void P_PlayerThink (player_t *player)
|
||||||
player->original_cmd = cmd->ucmd;
|
player->original_cmd = cmd->ucmd;
|
||||||
// Don't interpolate the view for more than one tic
|
// Don't interpolate the view for more than one tic
|
||||||
player->cheats &= ~CF_INTERPVIEW;
|
player->cheats &= ~CF_INTERPVIEW;
|
||||||
|
player->prevbob = player->bob;
|
||||||
|
|
||||||
IFVIRTUALPTRNAME(player->mo, NAME_PlayerPawn, PlayerThink)
|
IFVIRTUALPTRNAME(player->mo, NAME_PlayerPawn, PlayerThink)
|
||||||
{
|
{
|
||||||
|
@ -1734,6 +1736,7 @@ DEFINE_FIELD_X(PlayerInfo, player_t, FOV)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, viewz)
|
DEFINE_FIELD_X(PlayerInfo, player_t, viewz)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, viewheight)
|
DEFINE_FIELD_X(PlayerInfo, player_t, viewheight)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, deltaviewheight)
|
DEFINE_FIELD_X(PlayerInfo, player_t, deltaviewheight)
|
||||||
|
DEFINE_FIELD_X(PlayerInfo, player_t, prevbob)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, bob)
|
DEFINE_FIELD_X(PlayerInfo, player_t, bob)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, Vel)
|
DEFINE_FIELD_X(PlayerInfo, player_t, Vel)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, centering)
|
DEFINE_FIELD_X(PlayerInfo, player_t, centering)
|
||||||
|
|
|
@ -49,7 +49,6 @@ class PlayerPawn : Actor
|
||||||
double ViewBob; // [SP] ViewBob Multiplier
|
double ViewBob; // [SP] ViewBob Multiplier
|
||||||
double FullHeight;
|
double FullHeight;
|
||||||
double curBob;
|
double curBob;
|
||||||
float prevBob;
|
|
||||||
|
|
||||||
meta Name HealingRadiusType;
|
meta Name HealingRadiusType;
|
||||||
meta Name InvulMode;
|
meta Name InvulMode;
|
||||||
|
@ -1573,7 +1572,6 @@ class PlayerPawn : Actor
|
||||||
virtual void PlayerThink()
|
virtual void PlayerThink()
|
||||||
{
|
{
|
||||||
let player = self.player;
|
let player = self.player;
|
||||||
prevBob = player.bob;
|
|
||||||
UserCmd cmd = player.cmd;
|
UserCmd cmd = player.cmd;
|
||||||
|
|
||||||
CheckFOV();
|
CheckFOV();
|
||||||
|
@ -2360,7 +2358,7 @@ class PlayerPawn : Actor
|
||||||
double bobVal = player.bob;
|
double bobVal = player.bob;
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
bobVal = prevBob;
|
bobVal = player.prevBob;
|
||||||
}
|
}
|
||||||
//[SP] Added in decorate player.viewbob checks
|
//[SP] Added in decorate player.viewbob checks
|
||||||
double bobx = (bobVal * BobIntensity * Rangex * ViewBob);
|
double bobx = (bobVal * BobIntensity * Rangex * ViewBob);
|
||||||
|
@ -2648,6 +2646,7 @@ struct PlayerInfo native play // self is what internally is known as player_t
|
||||||
native double viewz;
|
native double viewz;
|
||||||
native double viewheight;
|
native double viewheight;
|
||||||
native double deltaviewheight;
|
native double deltaviewheight;
|
||||||
|
native float prevbob;
|
||||||
native double bob;
|
native double bob;
|
||||||
native vector2 vel;
|
native vector2 vel;
|
||||||
native bool centering;
|
native bool centering;
|
||||||
|
|
Loading…
Reference in a new issue