Code: Select all
gFaceAngle = (atan2(pSpawnClosest->X - pChar->X, pChar->Y - pSpawnClosest->Y) * 256.0f / PI);Code: Select all
gFaceAngle = (atan2(pSpawnClosest->X - pChar->X, pSpawnClosest->Y - pChar->Y) * 256.0f / PI);Moderator: MacroQuest Developers
Code: Select all
gFaceAngle = (atan2(pSpawnClosest->X - pChar->X, pChar->Y - pSpawnClosest->Y) * 256.0f / PI);Code: Select all
gFaceAngle = (atan2(pSpawnClosest->X - pChar->X, pSpawnClosest->Y - pChar->Y) * 256.0f / PI);Since atan2 uses the sign of x and y the order of subtraction would make a difference.atan2 uses the signs of both parameters to determine the quadrant of the return value.