diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-10-16 00:24:51 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-10-16 00:24:51 +0300 |
commit | 4914eb29d1f230346b1735fb3d7024e5c18bbf14 (patch) | |
tree | bb8bc09e82617aab20add9ba086b0af594c449a0 /src | |
parent | 825953bbdccb4d5e10ee8e932ca2025e5eb7e0a9 (diff) | |
download | minetest-4914eb29d1f230346b1735fb3d7024e5c18bbf14.tar.gz minetest-4914eb29d1f230346b1735fb3d7024e5c18bbf14.tar.bz2 minetest-4914eb29d1f230346b1735fb3d7024e5c18bbf14.zip |
Replace M_PI with PI
Diffstat (limited to 'src')
-rw-r--r-- | src/content_cao.cpp | 2 | ||||
-rw-r--r-- | src/content_sao.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index d9b88967d..0c533a362 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1020,7 +1020,7 @@ void MobV2CAO::step(float dtime, ClientEnvironment *env) else if(cam_to_mob.Y < -0.75) col = 4; else{ - float mob_dir = atan2(cam_to_mob.Z, cam_to_mob.X) / M_PI * 180.; + float mob_dir = atan2(cam_to_mob.Z, cam_to_mob.X) / PI * 180.; float dir = mob_dir - m_yaw; dir = wrapDegrees_180(dir); //dstream<<"id="<<m_id<<" dir="<<dir<<std::endl; diff --git a/src/content_sao.cpp b/src/content_sao.cpp index c849c7a98..8b1002c5a 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1114,7 +1114,7 @@ void MobV2SAO::step(float dtime, bool send_recommended) disturbing_player_distance = disturbing_player_off.getLength(); disturbing_player_norm = disturbing_player_off; disturbing_player_norm.normalize(); - disturbing_player_dir = 180./M_PI*atan2(disturbing_player_norm.Z, + disturbing_player_dir = 180./PI*atan2(disturbing_player_norm.Z, disturbing_player_norm.X); } @@ -1211,7 +1211,7 @@ void MobV2SAO::step(float dtime, bool send_recommended) v3f next_pos_f = intToFloat(m_next_pos_i, BS); v3f v = next_pos_f - pos_f; - m_yaw = atan2(v.Z, v.X) / M_PI * 180; + m_yaw = atan2(v.Z, v.X) / PI * 180; v3f diff = next_pos_f - pos_f; v3f dir = diff; @@ -1336,7 +1336,7 @@ u16 MobV2SAO::punch(const std::string &toolname, v3f dir, m_disturbing_player = playername; m_next_pos_exists = false; // Cancel moving immediately - m_yaw = wrapDegrees_180(180./M_PI*atan2(dir.Z, dir.X) + 180.); + m_yaw = wrapDegrees_180(180./PI*atan2(dir.Z, dir.X) + 180.); v3f new_base_position = m_base_position + dir * BS; { v3s16 pos_i = floatToInt(new_base_position, BS); |