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>2011-02-06 12:01:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-06 12:01:01 +0300
commitc82da98f3d5cb43a9cae446df5529a1fd5566ad5 (patch)
tree603eb91e727b20fcce897fa06c75d9b4016a0707 /source/blender/blenlib
parent967299ad976a669f763d728d5a8a0f030636a740 (diff)
bugfix [#25824] Quats + Camera + Fly = Madness
ensure quat, delta rotation is set to a unit quaternion on older files.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_vector.h1
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index d6d9c0a1c22..16b8ff8e472 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -123,6 +123,7 @@ void mid_v3_v3v3(float r[3], const float a[3], const float b[3]);
/********************************* Comparison ********************************/
MINLINE int is_zero_v3(const float a[3]);
+MINLINE int is_zero_v4(const float a[4]);
MINLINE int is_one_v3(const float a[3]);
MINLINE int equals_v2v2(const float *v1, const float *v2);
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index a01455c8df0..ae1b443bc56 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -427,11 +427,16 @@ MINLINE void normal_float_to_short_v3(short *out, const float *in)
/********************************* Comparison ********************************/
-MINLINE int is_zero_v3(const float *v)
+MINLINE int is_zero_v3(const float v[3])
{
return (v[0] == 0 && v[1] == 0 && v[2] == 0);
}
+MINLINE int is_zero_v4(const float v[4])
+{
+ return (v[0] == 0 && v[1] == 0 && v[2] == 0 && v[3] == 0);
+}
+
MINLINE int is_one_v3(const float *v)
{
return (v[0] == 1 && v[1] == 1 && v[2] == 1);