Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/collada/BCSampleData.cpp')
-rw-r--r--source/blender/collada/BCSampleData.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/collada/BCSampleData.cpp b/source/blender/collada/BCSampleData.cpp
index 88a7fd5993c..0734a2eb048 100644
--- a/source/blender/collada/BCSampleData.cpp
+++ b/source/blender/collada/BCSampleData.cpp
@@ -203,13 +203,15 @@ void BCMatrix::unit()
* precision = -1 indicates to not limit the precision. */
void BCMatrix::get_matrix(DMatrix &mat, const bool transposed, const int precision) const
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
float val = (transposed) ? matrix[j][i] : matrix[i][j];
- if (precision >= 0)
+ if (precision >= 0) {
val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
+ }
mat[i][j] = val;
}
+ }
}
void BCMatrix::get_matrix(Matrix &mat,
@@ -217,13 +219,15 @@ void BCMatrix::get_matrix(Matrix &mat,
const int precision,
const bool inverted) const
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
float val = (transposed) ? matrix[j][i] : matrix[i][j];
- if (precision >= 0)
+ if (precision >= 0) {
val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
+ }
mat[i][j] = val;
}
+ }
if (inverted) {
invert_m4(mat);