diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2008-05-07 16:45:02 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2008-05-07 16:45:02 +0400 |
commit | 50acbe29d1c486b3f7fe1fb31b7be0963e7f7748 (patch) | |
tree | 999f6ca0c20328d778176829216da91512048b47 /source/blender/blenkernel/BKE_shrinkwrap.h | |
parent | 0b7ab2f8ec1405b60262a13cf5d1ed671579dd69 (diff) |
Normal projection:
+added option to remove faces where all vertices got unprojected
Nearest surface point
+15% faster closest point on point-tri function
(archived by projecting the point on tri-plane and solving the problem on 2D)
(its still using bruteforce on triangles.. I'll add the right data structure later)
Diffstat (limited to 'source/blender/blenkernel/BKE_shrinkwrap.h')
-rw-r--r-- | source/blender/blenkernel/BKE_shrinkwrap.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 03c3f897dd4..babdcd78261 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -1,5 +1,5 @@ /** - * shrinkwrap.c + * BKE_shrinkwrap.h * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -29,11 +29,24 @@ #ifndef BKE_SHRINKWRAP_H #define BKE_SHRINKWRAP_H +/* bitset stuff */ +//TODO: should move this to other generic lib files? +typedef char* BitSet; +#define bitset_memsize(size) (sizeof(char)*((size+7)>>3)) + +#define bitset_new(size,name) ((BitSet)MEM_callocN( bitset_memsize(size) , name)) +#define bitset_free(set) (MEM_freeN((void*)set)) + +#define bitset_get(set,index) ((set)[(index)>>3] & (1 << ((index)&0x7))) +#define bitset_set(set,index) ((set)[(index)>>3] |= (1 << ((index)&0x7))) + + struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; + typedef struct ShrinkwrapCalcData { ShrinkwrapModifierData *smd; //shrinkwrap modifier data @@ -50,7 +63,7 @@ typedef struct ShrinkwrapCalcData float keptDist; //Distance to kept from target (units are in local space) //float *weights; //weights of vertexs - unsigned char *moved; //boolean indicating if vertex has moved (TODO use bitmaps) + BitSet moved; //BitSet indicating if vertex has moved } ShrinkwrapCalcData; |