Replaced fabs with fabsf where appropriate

This commit is contained in:
korenkonder
2023-10-08 17:32:03 +03:00
parent 75926d538a
commit fde41a7b4a
7 changed files with 14 additions and 14 deletions
+6 -6
View File
@@ -1164,17 +1164,17 @@ void AetObj::CalcMat(mat4& mat, const aet_layer* layer, float_t frame) {
}
mat4_translate_mult(&mat, pos_x, pos_y, -pos_z, &mat);
if (fabs(dir_x) > 0.000001f)
if (fabsf(dir_x) > 0.000001f)
mat4_rotate_x_mult(&mat, -dir_x, &mat);
if (fabs(dir_y) > 0.000001f)
if (fabsf(dir_y) > 0.000001f)
mat4_rotate_y_mult(&mat, -dir_y, &mat);
if (fabs(dir_z) > 0.000001f)
if (fabsf(dir_z) > 0.000001f)
mat4_rotate_z_mult(&mat, dir_z * scale_size.x * scale_size.y, &mat);
if (fabs(rot_x) > 0.000001f)
if (fabsf(rot_x) > 0.000001f)
mat4_rotate_x_mult(&mat, -rot_x, &mat);
if (fabs(rot_y) > 0.000001f)
if (fabsf(rot_y) > 0.000001f)
mat4_rotate_y_mult(&mat, -rot_y, &mat);
if (fabs(rot_z) > 0.000001f)
if (fabsf(rot_z) > 0.000001f)
mat4_rotate_z_mult(&mat, rot_z * scale_size.x * scale_size.y, &mat);
mat4_scale_rot(&mat, scale_x, scale_y, scale_z, &mat);
mat4_translate_mult(&mat, -anchor_x, -anchor_y, -anchor_z, &mat);
+2 -2
View File
@@ -447,8 +447,8 @@ void light_set::data_set(face& face, light_set_id id) {
vec4 light_reflect_dir;
lights[LIGHT_CHARA].get_position(light_reflect_dir);
if (fabs(light_reflect_dir.x) <= 0.000001f && fabs(light_reflect_dir.y) <= 0.000001f
&& fabs(light_reflect_dir.z) <= 0.000001f)
if (fabsf(light_reflect_dir.x) <= 0.000001f && fabsf(light_reflect_dir.y) <= 0.000001f
&& fabsf(light_reflect_dir.z) <= 0.000001f)
*(vec3*)&light_reflect_dir = vec3(0.0f, 1.0f, 0.0f);
else {
float_t length = vec3::length(*(vec3*)&light_reflect_dir);
+2 -2
View File
@@ -999,7 +999,7 @@ namespace pv_param_task {
}
float_t value;
if (fabs(i.duration) <= 0.000001)
if (fabsf(i.duration) <= 0.000001f)
value = i.alpha;
else if (i.duration <= 0.0)
value = i.prev_alpha;
@@ -1059,7 +1059,7 @@ namespace pv_param_task {
}
float_t value;
if (fabs(i.duration) <= 0.000001)
if (fabsf(i.duration) <= 0.000001f)
value = i.alpha;
else if (i.duration <= 0.0)
value = i.prev_alpha;
+1 -1
View File
@@ -1038,7 +1038,7 @@ void TaskEffectFogRing::Data::Ctrl() {
}
void TaskEffectFogRing::Data::CtrlInner(float_t delta_time) {
if (fabs(delta_time) <= 0.000001f)
if (fabsf(delta_time) <= 0.000001f)
return;
sub_140347B40(delta_time);
+1 -1
View File
@@ -2097,7 +2097,7 @@ inline void mat4_get_rotation(const mat4* x, vec3* z) {
else
z->y = asinf(-x->row0.z);
if (fabs(x->row0.z) < 0.99999899f) {
if (fabsf(x->row0.z) < 0.99999899f) {
z->x = atan2f(x->row1.z, x->row2.z);
z->z = atan2f(x->row0.y, x->row0.x);
}
+1 -1
View File
@@ -88,7 +88,7 @@ static bool a3da_to_dof_data(const char* a3da_path, dft_dsc_data& data) {
for (int32_t i = 0; i < data.frames; i++) {
cam_a3da.dof.model_transform.interpolate((float_t)i);
bool enable = fabs(cam_a3da.dof.model_transform.rotation_value.z) > 0.000001f;
bool enable = fabsf(cam_a3da.dof.model_transform.rotation_value.z) > 0.000001f;
if (!enable) {
data.dof_index.push_back(0);
continue;
+1 -1
View File
@@ -136,7 +136,7 @@ void pv_play_data_motion_data::ctrl_inner() {
rob_chr->set_osage_reset();
if (rob_chr->check_for_ageageagain_module()) {
if (fabs(vec3::distance(start_pos, end_pos) <= 0.000001f && fabsf(end_rot - start_rot) <= 0.000001f)) {
if (fabsf(vec3::distance(start_pos, end_pos) <= 0.000001f && fabsf(end_rot - start_rot) <= 0.000001f)) {
rob_chara_age_age_array_set_skip(rob_chr->chara_id, 1);
rob_chara_age_age_array_set_skip(rob_chr->chara_id, 2);
}