diff options
author | Hallam Roberts <MysteryPancake> | 2022-03-11 18:14:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-03-11 20:27:58 +0300 |
commit | 3da84d8b086bd2d09beb5bdb89ba6beddf1e1dd6 (patch) | |
tree | 698e6793ba776716a256abf10ed4b1623ade15eb /source/blender/io | |
parent | 62a0984d7290cbd6fd3acfa79d53765f97f93b0a (diff) |
Cleanup: use M_PI_2 and M_PI_4 where possible
The constant M_PI_4 is added to GLSL to ensure it works there too.
Differential Revision: https://developer.blender.org/D14288
Diffstat (limited to 'source/blender/io')
-rw-r--r-- | source/blender/io/collada/collada_internal.cpp | 4 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_capi_import.cc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/io/collada/collada_internal.cpp b/source/blender/io/collada/collada_internal.cpp index db27236b885..da9a4cd4a9b 100644 --- a/source/blender/io/collada/collada_internal.cpp +++ b/source/blender/io/collada/collada_internal.cpp @@ -14,8 +14,8 @@ UnitConverter::UnitConverter() : up_axis(COLLADAFW::FileInfo::Z_UP) { - axis_angle_to_mat4_single(x_up_mat4, 'Y', -0.5 * M_PI); - axis_angle_to_mat4_single(y_up_mat4, 'X', 0.5 * M_PI); + axis_angle_to_mat4_single(x_up_mat4, 'Y', -M_PI_2); + axis_angle_to_mat4_single(y_up_mat4, 'X', M_PI_2); unit_m4(z_up_mat4); unit_m4(scale_mat4); diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc index 6186e2bb61f..49d5251198a 100644 --- a/source/blender/io/usd/intern/usd_capi_import.cc +++ b/source/blender/io/usd/intern/usd_capi_import.cc @@ -102,7 +102,7 @@ static void convert_to_z_up(pxr::UsdStageRefPtr stage, ImportSettings *r_setting /* Rotate 90 degrees about the X-axis. */ float rmat[3][3]; float axis[3] = {1.0f, 0.0f, 0.0f}; - axis_angle_normalized_to_mat3(rmat, axis, M_PI / 2.0f); + axis_angle_normalized_to_mat3(rmat, axis, M_PI_2); unit_m4(r_settings->conversion_mat); copy_m4_m3(r_settings->conversion_mat, rmat); |