diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-09-02 06:10:14 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-09-02 06:10:14 +0400 |
commit | f479aec4924d24b023ba285e65bbb5faf5bc4761 (patch) | |
tree | 2feeb340532400f9b9ffe04966f49919082ef8c0 /source/blender/blenlib | |
parent | 276c162e56a5ebee4ae602e196580b44779695ee (diff) |
Memoization based solver for inner joint placement. Pretty much reduces the problem from a monstruous exponential to a quadratic cake.
Thanks to jaguarandi for initial pointers.
Changes in arith is a simple added function to check for null vectors.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_arithb.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index ccb592bba05..a0fde98843d 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -243,6 +243,7 @@ void VecMulf(float *v1, float f); int VecLenCompare(float *v1, float *v2, float limit); int VecCompare(float *v1, float *v2, float limit); int VecEqual(float *v1, float *v2); +int VecIsNull(float *v); void printvecf(char *str,float v[3]); void printvec4f(char *str, float v[4]); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 4cc8e45b1cf..3083078abac 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2188,6 +2188,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]; |