diff options
Diffstat (limited to 'source/blender/collada/BCSampleData.cpp')
-rw-r--r-- | source/blender/collada/BCSampleData.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/collada/BCSampleData.cpp b/source/blender/collada/BCSampleData.cpp index ceb0e07b9eb..cf3668a08af 100644 --- a/source/blender/collada/BCSampleData.cpp +++ b/source/blender/collada/BCSampleData.cpp @@ -66,7 +66,7 @@ BCMatrix::BCMatrix(BC_global_forward_axis global_forward_axis, BC_global_up_axis mat3_from_axis_conversion( BC_DEFAULT_FORWARD, BC_DEFAULT_UP, global_forward_axis, global_up_axis, mrot); - // transpose_m3(mrot); // Assume that mat3_from_axis_conversion() returns a transposed matrix + transpose_m3(mrot); // TODO: Verify that mat3_from_axis_conversion() returns a transposed matrix copy_m4_m3(mat, mrot); set_transform(mat); } @@ -81,8 +81,25 @@ void BCMatrix::add_transform(const BCMatrix &mat, bool inverse) add_transform(this->matrix, mat.matrix, this->matrix, inverse); } +void BCMatrix::apply_transform(const BCMatrix &mat, bool inverse) +{ + apply_transform(this->matrix, mat.matrix, this->matrix, inverse); +} + void BCMatrix::add_transform(Matrix &to, const Matrix &transform, const Matrix &from, bool inverse) { + if (inverse) { + Matrix globinv; + invert_m4_m4(globinv, transform); + add_transform(to, globinv, from, /*inverse=*/false); + } + else { + mul_m4_m4m4(to, transform, from); + } +} + +void BCMatrix::apply_transform(Matrix &to, const Matrix &transform, const Matrix &from, bool inverse) +{ Matrix globinv; invert_m4_m4(globinv, transform); if (inverse) { |