- Remove PlayerAngles::setPitch() method usage.

This commit is contained in:
Mitchell Richters 2022-12-03 14:53:53 +11:00 committed by Christoph Oelckers
parent 491a42d2bb
commit f58e3c58aa
5 changed files with 11 additions and 17 deletions

View file

@ -88,9 +88,6 @@ struct PlayerAngles
return offsets; return offsets;
} }
// Pitch methods.
void setPitch(const DAngle value, const bool backup = false) { updateAngle(PITCH, ClampViewPitch(value), backup); }
// Yaw methods. // Yaw methods.
void setYaw(const DAngle value, const bool backup = false) { updateAngle(YAW, value, backup); } void setYaw(const DAngle value, const bool backup = false) { updateAngle(YAW, value, backup); }

View file

@ -2187,7 +2187,7 @@ void trPlayerCtrlSetLookAngle(int value, PLAYER* pPlayer)
if (const double adjustment = clamp(value * 0.125 * (value > 0 ? lookStepUp : lookStepDown), downAngle, upAngle)) if (const double adjustment = clamp(value * 0.125 * (value > 0 ? lookStepUp : lookStepDown), downAngle, upAngle))
{ {
setForcedSyncInput(); setForcedSyncInput();
pPlayer->Angles.setPitch(maphoriz(-100. * tan(adjustment * pi::pi() * (1. / 1024.)))); pPlayer->actor->spr.Angles.Pitch = maphoriz(-100. * tan(adjustment * pi::pi() * (1. / 1024.)));
} }
} }

View file

@ -344,7 +344,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
{ {
ps[iPlayer].sync.actions &= ~SB_CENTERVIEW; ps[iPlayer].sync.actions &= ~SB_CENTERVIEW;
} }
ps[iPlayer].Angles.setPitch(maphoriz(-lValue)); ps[iPlayer].GetActor()->spr.Angles.Pitch = maphoriz(-lValue);
} }
else SetGameVarID(lVar2, int(ps[iPlayer].GetActor()->spr.Angles.Pitch.Tan() * -128.), sActor, sPlayer); else SetGameVarID(lVar2, int(ps[iPlayer].GetActor()->spr.Angles.Pitch.Tan() * -128.), sActor, sPlayer);
break; break;

View file

@ -3880,7 +3880,7 @@ void OnMotorcycle(player_struct *p)
p->gotweapon[MOTORCYCLE_WEAPON] = true; p->gotweapon[MOTORCYCLE_WEAPON] = true;
p->vel.X = 0; p->vel.X = 0;
p->vel.Y = 0; p->vel.Y = 0;
p->Angles.setPitch(nullAngle); p->GetActor()->spr.Angles.Pitch = nullAngle;
} }
if (!S_CheckActorSoundPlaying(p->GetActor(),186)) if (!S_CheckActorSoundPlaying(p->GetActor(),186))
S_PlayActorSound(186, p->GetActor()); S_PlayActorSound(186, p->GetActor());
@ -3911,7 +3911,7 @@ void OffMotorcycle(player_struct *p)
p->gotweapon[MOTORCYCLE_WEAPON] = false; p->gotweapon[MOTORCYCLE_WEAPON] = false;
p->curr_weapon = p->last_full_weapon; p->curr_weapon = p->last_full_weapon;
checkavailweapon(p); checkavailweapon(p);
p->Angles.setPitch(nullAngle); p->GetActor()->spr.Angles.Pitch = nullAngle;
p->moto_do_bump = 0; p->moto_do_bump = 0;
p->MotoSpeed = 0; p->MotoSpeed = 0;
p->TiltStatus = 0; p->TiltStatus = 0;
@ -3947,7 +3947,7 @@ void OnBoat(player_struct *p)
p->gotweapon[BOAT_WEAPON] = true; p->gotweapon[BOAT_WEAPON] = true;
p->vel.X = 0; p->vel.X = 0;
p->vel.Y = 0; p->vel.Y = 0;
p->Angles.setPitch(nullAngle); p->GetActor()->spr.Angles.Pitch = nullAngle;
} }
} }
@ -3965,7 +3965,7 @@ void OffBoat(player_struct *p)
p->gotweapon[BOAT_WEAPON] = false; p->gotweapon[BOAT_WEAPON] = false;
p->curr_weapon = p->last_full_weapon; p->curr_weapon = p->last_full_weapon;
checkavailweapon(p); checkavailweapon(p);
p->Angles.setPitch(nullAngle); p->GetActor()->spr.Angles.Pitch = nullAngle;
p->moto_do_bump = 0; p->moto_do_bump = 0;
p->MotoSpeed = 0; p->MotoSpeed = 0;
p->TiltStatus = 0; p->TiltStatus = 0;

View file

@ -1069,11 +1069,8 @@ void AIPlayer::Tick(RunListEvent* ev)
{ {
if (nTotalPlayers <= 1) if (nTotalPlayers <= 1)
{ {
auto ang = GetAngleToSprite(pPlayerActor, pSpiritSprite); pPlayerActor->spr.Angles = DRotator(nullAngle, GetAngleToSprite(pPlayerActor, pSpiritSprite), nullAngle);
PlayerList[nPlayer].Angles.setYaw(ang, true); pPlayerActor->backupang();
pPlayerActor->spr.Angles.Yaw = ang;
PlayerList[nPlayer].Angles.setPitch(nullAngle, true);
sPlayerInput[nPlayer].vel.Zero(); sPlayerInput[nPlayer].vel.Zero();
pPlayerActor->vel.Zero(); pPlayerActor->vel.Zero();
@ -1086,7 +1083,7 @@ void AIPlayer::Tick(RunListEvent* ev)
InitSpiritHead(); InitSpiritHead();
PlayerList[nPlayer].nDestVertPan = nullAngle; PlayerList[nPlayer].nDestVertPan = nullAngle;
PlayerList[nPlayer].Angles.setPitch(currentLevel->ex_ramses_horiz); pPlayerActor->spr.Angles.Pitch = currentLevel->ex_ramses_horiz;
} }
} }
else else
@ -2616,7 +2613,7 @@ sectdone:
{ {
if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() > 0) if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() > 0)
{ {
PlayerList[nPlayer].Angles.setPitch(nullAngle); pPlayerActor->spr.Angles.Pitch = nullAngle;
pPlayerActor->viewzoffset -= dVertPan[nPlayer]; pPlayerActor->viewzoffset -= dVertPan[nPlayer];
} }
else else
@ -2625,7 +2622,7 @@ sectdone:
if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Degrees() <= 38) if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Degrees() <= 38)
{ {
PlayerList[nPlayer].Angles.setPitch(DAngle::fromDeg(-37.72)); PlayerList[nPlayer].pActor->spr.Angles.Pitch = DAngle::fromDeg(-37.72);
} }
else if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() >= 0) else if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() >= 0)
{ {