Skip to content

Commit 9e9fc22

Browse files
fix type conversion issue in vecmat (scp-fs2open#6749)
1 parent 829edaa commit 9e9fc22

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

code/math/vecmat.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,10 +1715,10 @@ float vm_closest_angle_to_matrix(const matrix* mat, const vec3d* rot_axis, float
17151715
//If we support IEEE float handling, we don't need this, the div by 0 will be handled correctly with the INF. If not, do this:
17161716
const float yz_recip = (!std::numeric_limits<float>::is_iec559 && y * z < 0.001f) ? FLT_MAX : 1.0f / (y * z);
17171717

1718-
solutions = { 2 * atan2(-sr_neg * (y * y + sr) * yz_recip, -2 * sr_neg),
1719-
2 * atan2(sr_neg * (y * y + sr) * yz_recip, 2 * sr_neg),
1720-
2 * atan2(-sr_pos * (y * y - sr) * yz_recip, -2 * sr_pos),
1721-
2 * atan2(sr_pos * (y * y - sr) * yz_recip, 2 * sr_pos) };
1718+
solutions = { 2.0f * atan2f(-sr_neg * (y * y + sr) * yz_recip, -2.0f * sr_neg),
1719+
2.0f * atan2f(sr_neg * (y * y + sr) * yz_recip, 2.0f * sr_neg),
1720+
2.0f * atan2f(-sr_pos * (y * y - sr) * yz_recip, -2.0f * sr_pos),
1721+
2.0f * atan2f(sr_pos * (y * y - sr) * yz_recip, 2.0f * sr_pos) };
17221722
}
17231723
float value = -2.0f;
17241724
float correct = 0;

0 commit comments

Comments
 (0)