From 9892736206676c5b7fabc8d1184f9655511ff2dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 May 2012 20:39:39 +0000 Subject: code cleanup: header cleanup and remove some duplicate defines. --- source/blender/blenlib/BLI_kdopbvh.h | 37 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'source/blender/blenlib/BLI_kdopbvh.h') diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index ff3017fef03..7041c122ff9 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -49,37 +49,34 @@ typedef struct BVHTreeOverlap { int indexB; } 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 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 */ +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 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; -typedef struct BVHTreeRay -{ - float origin[3]; /* ray origin */ - float direction[3]; /* ray direction */ - float radius; /* radius around ray */ +typedef struct BVHTreeRay { + float origin[3]; /* ray origin */ + float direction[3]; /* ray direction */ + float radius; /* radius around ray */ } BVHTreeRay; -typedef struct BVHTreeRayHit -{ - int index; /* index of the tree node (untouched if no hit is found) */ - float co[3]; /* coordinates of the hit point */ - float no[3]; /* normal on hit point */ - float dist; /* distance to the hit point */ +typedef struct BVHTreeRayHit { + int index; /* index of the tree node (untouched if no hit is found) */ + float co[3]; /* coordinates of the hit point */ + float no[3]; /* normal on hit point */ + float dist; /* distance to the hit point */ } BVHTreeRayHit; /* callback must update nearest in case it finds a nearest result */ -typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, BVHTreeNearest *nearest); +typedef void (*BVHTree_NearestPointCallback)(void *userdata, int index, const float *co, BVHTreeNearest *nearest); /* 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); +typedef void (*BVHTree_RayCastCallback)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); /* callback to range search query */ -typedef void (*BVHTree_RangeQuery) (void *userdata, int index, float squared_dist); +typedef void (*BVHTree_RangeQuery)(void *userdata, int index, float squared_dist); BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); void BLI_bvhtree_free(BVHTree *tree); -- cgit v1.2.3