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>2016-11-25 08:20:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-11-25 08:39:34 +0300
commite1e49fd1a8a5bca7f95ba230a7daf12fb059779b (patch)
tree9913ba1244a0904189361058713489666d64d2dc /source/blender/blenkernel/intern
parentd30a0239a2fb1bf28befc547d9c4986b6be4d662 (diff)
Math Lib: rotate matrix cleanup
- Remove 'rotate_m2', unlike 'rotate_m4' it created a new matrix duplicating 'angle_to_mat2' - now used instead. (better avoid matching functions having different behavior). - Add 'axis_angle_to_mat4_single', convenience wrapper for 'axis_angle_to_mat3_single'. - Replace 'unit_m4(), rotate_m4()' with a single call to 'axis_angle_to_mat4_single'.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c3
-rw-r--r--source/blender/blenkernel/intern/tracking_stabilize.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 14cc5ec0849..e3b801b3193 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -642,8 +642,7 @@ static void make_duplis_font(const DupliContext *ctx)
float rmat[4][4];
zero_v3(obmat[3]);
- unit_m4(rmat);
- rotate_m4(rmat, 'Z', -ct->rot);
+ axis_angle_to_mat4_single(rmat, 'Z', -ct->rot);
mul_m4_m4m4(obmat, obmat, rmat);
}
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c
index b8949f9a0de..36b24fbb2dc 100644
--- a/source/blender/blenkernel/intern/tracking_stabilize.c
+++ b/source/blender/blenkernel/intern/tracking_stabilize.c
@@ -587,7 +587,7 @@ static void compensate_rotation_center(const int size, float aspect,
copy_v2_v2(intended_pivot, pivot);
copy_v2_v2(rotated_pivot, pivot);
- rotate_m2(rotation_mat, +angle);
+ angle_to_mat2(rotation_mat, +angle);
sub_v2_v2(rotated_pivot, origin);
mul_m2v2(rotation_mat, rotated_pivot);
mul_v2_fl(rotated_pivot, scale);
@@ -967,7 +967,7 @@ static void initialize_track_for_stabilization(StabContext *ctx,
pos[0] *= aspect;
angle = average_angle - atan2f(pos[1],pos[0]);
- rotate_m2(local_data->stabilization_rotation_base, angle);
+ angle_to_mat2(local_data->stabilization_rotation_base, angle);
/* Per track baseline value for zoom. */
len = len_v2(pos) + SCALE_ERROR_LIMIT_BIAS;