From df41f7bf4f1b16d833eb548e57b4512dfb1a3bfa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Jul 2015 17:39:33 +1000 Subject: Use const for BVH mesh arrays --- source/blender/blenkernel/BKE_bvhutils.h | 40 +++++++++++++++++++------------- 1 file changed, 24 insertions(+), 16 deletions(-) (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 a360511dcd3..e78fa65bbbf 100644 --- a/source/blender/blenkernel/BKE_bvhutils.h +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -53,9 +53,9 @@ typedef struct BVHTreeFromMesh { BVHTree_RayCastCallback raycast_callback; /* Vertex array, so that callbacks have instante access to data */ - struct MVert *vert; - struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */ - struct MFace *face; + const struct MVert *vert; + const struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */ + const struct MFace *face; bool vert_allocated; bool edge_allocated; bool face_allocated; @@ -69,7 +69,7 @@ typedef struct BVHTreeFromMesh { } BVHTreeFromMesh; -/* +/** * Builds a bvh tree where nodes are the relevant elements of the given mesh. * Configures BVHTreeFromMesh. * @@ -79,18 +79,26 @@ typedef struct BVHTreeFromMesh { * * free_bvhtree_from_mesh should be called when the tree is no longer needed. */ -BVHTree *bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); -BVHTree *bvhtree_from_mesh_verts_ex(struct BVHTreeFromMesh *data, struct MVert *vert, const int numVerts, - const bool vert_allocated, BLI_bitmap *mask, int numVerts_active, - float epsilon, int tree_type, int axis); - -BVHTree *bvhtree_from_mesh_edges(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); - -BVHTree *bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); -BVHTree *bvhtree_from_mesh_faces_ex(struct BVHTreeFromMesh *data, struct MVert *vert, const bool vert_allocated, - struct MFace *face, const int numFaces, const bool face_allocated, - BLI_bitmap *mask, int numFaces_active, - float epsilon, int tree_type, int axis); +BVHTree *bvhtree_from_mesh_verts( + struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); +BVHTree *bvhtree_from_mesh_verts_ex( + struct BVHTreeFromMesh *data, struct MVert *vert, const int numVerts, + const bool vert_allocated, BLI_bitmap *mask, int numVerts_active, + float epsilon, int tree_type, int axis); + +BVHTree *bvhtree_from_mesh_edges( + struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, + float epsilon, int tree_type, int axis); + +BVHTree *bvhtree_from_mesh_faces( + struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, + int tree_type, int axis); +BVHTree *bvhtree_from_mesh_faces_ex( + struct BVHTreeFromMesh *data, + struct MVert *vert, const bool vert_allocated, + struct MFace *face, 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_*. -- cgit v1.2.3