diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2018-11-27 01:05:55 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2018-11-27 01:14:45 +0300 |
commit | 65874d3f33c5bbc2d91b3239ca549a635a12ba29 (patch) | |
tree | 278f03954250fcf94c2a38114cbd9135181b89dc /source/blender/collada/collada_utils.cpp | |
parent | f753fd17799cc92410b6115ea5ad9f3c2151072f (diff) |
fix: Collada: The limit precision option does nothing
Diffstat (limited to 'source/blender/collada/collada_utils.cpp')
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 41e661ffd40..3a0fb9fd64f 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -1135,6 +1135,15 @@ void bc_sanitize_mat(float mat[4][4], int precision) } } +void bc_sanitize_v3(float v[3], int precision) +{ + for (int i = 0; i < 3; i++) { + double val = (double)v[i]; + val = double_round(val, precision); + v[i] = (float)val; + } +} + void bc_sanitize_mat(double mat[4][4], int precision) { for (int i = 0; i < 4; i++) @@ -1142,6 +1151,13 @@ void bc_sanitize_mat(double mat[4][4], int precision) mat[i][j] = double_round(mat[i][j], precision); } +void bc_sanitize_v3(double v[3], int precision) +{ + for (int i = 0; i < 3; i++) { + v[i] = double_round(v[i], precision); + } +} + void bc_copy_m4_farray(float r[4][4], float *a) { for (int i = 0; i < 4; i++) |