Replace usages of atan2f and atan2 with std::atan2

Another leftover from #6372.
This commit is contained in:
Robert Müller 2023-05-09 22:38:44 +02:00
parent 1112c9e6b7
commit 58184c2d67
3 changed files with 4 additions and 4 deletions

View file

@ -1381,7 +1381,7 @@ void CHud::RenderMovementInformation(const int ClientID)
{
// On DDNet servers the more accurate angle is displayed, calculated from the target coordinates
CNetObj_DDNetCharacter *pExtendedData = &m_pClient->m_Snap.m_aCharacters[ClientID].m_ExtendedData;
Angle = atan2f(pExtendedData->m_TargetY, pExtendedData->m_TargetX);
Angle = std::atan2(pExtendedData->m_TargetY, pExtendedData->m_TargetX);
}
else
{

View file

@ -160,7 +160,7 @@ void CCharacterCore::Tick(bool UseInput, bool DoDeferredTick)
m_Direction = m_Input.m_Direction;
// setup angle
float TmpAngle = atan2f(m_Input.m_TargetY, m_Input.m_TargetX);
float TmpAngle = std::atan2(m_Input.m_TargetY, m_Input.m_TargetX);
if(TmpAngle < -(pi / 2.0f))
{
m_Angle = (int)((TmpAngle + (2.0f * pi)) * 256.0f);

View file

@ -233,7 +233,7 @@ void CProjectile::Tick()
}
else if(m_Type == WEAPON_GUN)
{
GameServer()->CreateDamageInd(CurPos, -atan2(m_Direction.x, m_Direction.y), 10, (m_Owner != -1) ? TeamMask : CClientMask().set());
GameServer()->CreateDamageInd(CurPos, -std::atan2(m_Direction.x, m_Direction.y), 10, (m_Owner != -1) ? TeamMask : CClientMask().set());
m_MarkedForDestroy = true;
return;
}
@ -380,7 +380,7 @@ bool CProjectile::FillExtraInfo(CNetObj_DDNetProjectile *pProj)
return false;
}
//Send additional/modified info, by modifying the fields of the netobj
float Angle = -atan2f(m_Direction.x, m_Direction.y);
float Angle = -std::atan2(m_Direction.x, m_Direction.y);
int Data = 0;
Data |= (absolute(m_Owner) & 255) << 0;