From b604d5ade0fde241c84b802b4f7b7426f12d48be Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Jul 2015 20:55:46 +1000 Subject: Add bvhtree_from_mesh_looptri utility function --- source/blender/blenkernel/BKE_bvhutils.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/blenkernel/BKE_bvhutils.h') diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h index a956933aa22..9220082a73a 100644 --- a/source/blender/blenkernel/BKE_bvhutils.h +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -56,9 +56,13 @@ typedef struct BVHTreeFromMesh { const struct MVert *vert; const struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */ const struct MFace *face; + const struct MLoop *loop; + const struct MLoopTri *looptri; bool vert_allocated; bool edge_allocated; bool face_allocated; + bool loop_allocated; + bool looptri_allocated; /* radius for raycast */ float sphere_radius; @@ -100,6 +104,16 @@ BVHTree *bvhtree_from_mesh_faces_ex( BLI_bitmap *mask, int numFaces_active, float epsilon, int tree_type, int axis); +BVHTree *bvhtree_from_mesh_looptri( + struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); +BVHTree *bvhtree_from_mesh_looptri_ex( + struct BVHTreeFromMesh *data, + const struct MVert *vert, const bool vert_allocated, + const struct MLoop *mloop, const bool loop_allocated, + const struct MLoopTri *looptri, const int numFaces, const bool face_allocated, + BLI_bitmap *mask, int numFaces_active, + float epsilon, int tree_type, int axis); + /** * Frees data allocated by a call to bvhtree_from_mesh_*. */ @@ -125,6 +139,7 @@ enum { BVHTREE_FROM_EDGES = 1, BVHTREE_FROM_FACES = 2, BVHTREE_FROM_FACES_EDITMESH = 3, + BVHTREE_FROM_LOOPTRI = 4, }; typedef struct LinkNode *BVHCache; -- cgit v1.2.3