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/blenlib/intern/math_matrix.c')
-rw-r--r--source/blender/blenlib/intern/math_matrix.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index c185fe1a16d..eb5c5f4aab4 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1236,11 +1236,22 @@ void size_to_mat3(float mat[3][3], const float size[3])
void size_to_mat4(float mat[4][4], const float size[3])
{
- float tmat[3][3];
-
- size_to_mat3(tmat, size);
- unit_m4(mat);
- copy_m4_m3(mat, tmat);
+ mat[0][0] = size[0];
+ mat[0][1] = 0.0f;
+ mat[0][2] = 0.0f;
+ mat[0][3] = 0.0f;
+ mat[1][0] = 0.0f;
+ mat[1][1] = size[1];
+ mat[1][2] = 0.0f;
+ mat[1][3] = 0.0f;
+ mat[2][0] = 0.0f;
+ mat[2][1] = 0.0f;
+ mat[2][2] = size[2];
+ mat[2][3] = 0.0f;
+ mat[3][0] = 0.0f;
+ mat[3][1] = 0.0f;
+ mat[3][2] = 0.0f;
+ mat[3][3] = 1.0f;
}
void mat3_to_size(float size[3], float mat[3][3])