mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
fix some abs() type conversion warnings
This commit is contained in:
3 files changed
+4
-4
No files matched your search
@@ -204,7 +204,7 @@ bool ik_constraint_window::constrain(matrix& localRot, bool /*backwardsPass*/) c
|
||||
|
||||
//Clamp absolute value of individual angles to window
|
||||
for (float angles::* i : pbh) {
|
||||
const float absAngle = abs(currentAngles.*i);
|
||||
const float absAngle = std::abs(currentAngles.*i);
|
||||
if(absAngle > absLimit.*i){
|
||||
needsClamp = true;
|
||||
currentAngles.*i = copysignf(std::min(absAngle, absLimit.*i), currentAngles.*i);
|
||||
|
||||
@@ -1065,7 +1065,7 @@ float get_submodel_delta_angle(const submodel_instance *smi)
|
||||
float get_submodel_delta_shift(const submodel_instance *smi)
|
||||
{
|
||||
// this is a bit simpler
|
||||
return abs(smi->cur_offset - smi->prev_offset);
|
||||
return std::abs(smi->cur_offset - smi->prev_offset);
|
||||
}
|
||||
|
||||
void do_new_subsystem( int n_subsystems, model_subsystem *slist, int subobj_num, float rad, const vec3d *pnt, char *props, const char *subobj_name, int model_num )
|
||||
@@ -4388,7 +4388,7 @@ void submodel_look_at(polymodel *pm, polymodel_instance *pmi, int submodel_num)
|
||||
|
||||
// calculate turn rate
|
||||
// (try to avoid a one-frame dramatic spike in the turn rate if the angle passes 0.0 or PI2)
|
||||
if (abs(smi->cur_angle - smi->prev_angle) < PI)
|
||||
if (std::abs(smi->cur_angle - smi->prev_angle) < PI)
|
||||
smi->current_turn_rate = smi->desired_turn_rate = (smi->cur_angle - smi->prev_angle) / flFrametime;
|
||||
|
||||
// and now set the other submodel fields
|
||||
|
||||
@@ -1249,7 +1249,7 @@ bool physics_lead_ballistic_trajectory(const vec3d* start, const vec3d* end_pos,
|
||||
|
||||
time = range / (weapon_speed * cosf(angle));
|
||||
|
||||
if (abs(time - best_guess_time) < 0.01f)
|
||||
if (std::abs(time - best_guess_time) < 0.01f)
|
||||
break;
|
||||
else
|
||||
best_guess_time = time;
|
||||
|
||||
Reference in new issue
Block a user