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:
authorCampbell Barton <ideasman42@gmail.com>2013-09-11 00:45:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-11 00:45:47 +0400
commitab8d88ac18f7310889d11d21f94fdca400b428e0 (patch)
tree4745687538eee2c08ab0c6327f52a4799afbe924 /source/blender/python
parent734eaab54542644f6a031858b4ca280cd565dc6a (diff)
add angle_to_mat2 utility function.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index d471cd05a2b..3e5dcc28903 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -522,18 +522,12 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
axis_angle_to_mat3((float (*)[3])mat, tvec, angle);
}
else if (matSize == 2) {
- const float angle_cos = cosf(angle);
- const float angle_sin = sinf(angle);
+ angle_to_mat2((float (*)[2])mat, angle);
- /* 2D rotation matrix */
- mat[0] = angle_cos;
- mat[1] = angle_sin;
- mat[2] = -angle_sin;
- mat[3] = angle_cos;
}
else {
/* valid axis checked above */
- single_axis_angle_to_mat3((float (*)[3])mat, axis[0], angle);
+ axis_angle_to_mat3_single((float (*)[3])mat, axis[0], angle);
}
if (matSize == 4) {