diff options
Diffstat (limited to 'source/blender/blenlib/BLI_kdopbvh.h')
-rw-r--r-- | source/blender/blenlib/BLI_kdopbvh.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index d090784e450..6d9c82a9626 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -43,7 +43,8 @@ typedef struct BVHTreeOverlap { typedef struct BVHTreeNearest { int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ - float nearest[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float co[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float no[3]; /* normal at nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ float dist; /* squared distance to search arround */ } BVHTreeNearest; @@ -61,11 +62,11 @@ typedef struct BVHTreeRayHit float dist; /* distance to the hit point */ } BVHTreeRayHit; -/* returns square of the minimum distance from given co to the node, nearest point is stored on nearest */ -typedef float (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, float *nearest); +/* callback must update nearest in case it finds a nearest result */ +typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, BVHTreeNearest *nearest); -/* returns the ray distancence from given co to the node, nearest point is stored on nearest */ -typedef float (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); +/* callback must update hit in case it finds a nearest successful hit */ +typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); |