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:
authorMartin Poirier <theeth@yahoo.com>2008-10-29 03:11:58 +0300
committerMartin Poirier <theeth@yahoo.com>2008-10-29 03:11:58 +0300
commit19094597b39682c3cf9289cfb20e280f54db82d3 (patch)
tree430c2ecc875aaf3fa2d29d579a753f9f3b7c2b28 /source/blender/blenlib/intern/arithb.c
parent3db27c9acbf0fa525b473e6b0d869275147ca487 (diff)
parent481831bd27b69b5afa6b54dab1e18bf5c8d27f6e (diff)
merge trunk 17122:17213
Diffstat (limited to 'source/blender/blenlib/intern/arithb.c')
-rw-r--r--source/blender/blenlib/intern/arithb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index 54e1bd5fc57..0db87a819bd 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -1371,6 +1371,18 @@ void NormalQuat(float *q)
}
}
+void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3])
+{
+ float axis[3];
+ float angle;
+
+ Crossf(axis, v1, v2);
+
+ angle = NormalizedVecAngle2(v1, v2);
+
+ AxisAngleToQuat(q, axis, angle);
+}
+
void AxisAngleToQuat(float *q, float *axis, float angle)
{
float nor[3];
@@ -2219,6 +2231,11 @@ int VecEqual(float *v1, float *v2)
return ((v1[0]==v2[0]) && (v1[1]==v2[1]) && (v1[2]==v2[2]));
}
+int VecIsNull(float *v)
+{
+ return (v[0] == 0 && v[1] == 0 && v[2] == 0);
+}
+
void CalcNormShort( short *v1, short *v2, short *v3, float *n) /* is also cross product */
{
float n1[3],n2[3];