diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-12 14:16:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-12 14:16:04 +0300 |
commit | ee7bf4dab58131923906108013316826b8669ca2 (patch) | |
tree | fa7094b121aa9496334674c9c18d5c8b56df273d /source/blender/blenlib | |
parent | 73a91bc5488fd1d26c2d819024e7356fa537560a (diff) |
take delta's into account when applying the objects matrix (dloc, drot, dsize).
Now object_apply_mat4() can be used as the reverse of object_to_mat4().
Noticeable result is fly mode and 'Apply Visual Transform' dont jump when deltas are used, also means setting matrix from python works as expected.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 3fceef36e2a..2e596951fef 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -63,6 +63,8 @@ MINLINE void sub_v2_v2(float r[2], const float a[2]); MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2]); MINLINE void sub_v3_v3(float r[3], const float a[3]); MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3]); +MINLINE void sub_v4_v4(float r[4], const float a[4]); +MINLINE void sub_v4_v4v4(float r[4], const float a[4], const float b[4]); MINLINE void mul_v2_fl(float r[2], float f); MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f); diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index a45356f0bde..6bccb0045fa 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -149,6 +149,23 @@ MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3]) r[2]= a[2] - b[2]; } +MINLINE void sub_v4_v4(float r[4], const float a[4]) +{ + r[0] -= a[0]; + r[1] -= a[1]; + r[2] -= a[2]; + r[3] -= a[3]; +} + +MINLINE void sub_v4_v4v4(float r[3], const float a[3], const float b[3]) +{ + r[0]= a[0] - b[0]; + r[1]= a[1] - b[1]; + r[2]= a[2] - b[2]; + r[3]= a[3] - b[3]; +} + + MINLINE void mul_v2_fl(float *v1, float f) { v1[0]*= f; |