diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-11 00:33:36 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-11 00:33:36 +0400 |
commit | f95f558a8c0a8ed2a9e1b4a642c6fe0b2b0d9e39 (patch) | |
tree | ad634039352e7f254a7582c9c6fd63e353463fd2 /source/blender/blenlib | |
parent | aa77bbd38daff45725d7e726e89f2e681cee863d (diff) |
Add access to mesh vertex customdata to the PBVH.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_pbvh.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/pbvh.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h index b69579128ba..b3e424b5916 100644 --- a/source/blender/blenlib/BLI_pbvh.h +++ b/source/blender/blenlib/BLI_pbvh.h @@ -30,6 +30,7 @@ struct CCGElem; struct CCGKey; +struct CustomData; struct DMFlagMat; struct DMGridAdjacency; struct ListBase; @@ -57,7 +58,7 @@ typedef void (*BLI_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float* PBVH *BLI_pbvh_new(void); void BLI_pbvh_build_mesh(PBVH *bvh, struct MFace *faces, struct MVert *verts, - int totface, int totvert); + int totface, int totvert, struct CustomData *vdata); void BLI_pbvh_build_grids(PBVH *bvh, struct CCGElem **grid_elems, struct DMGridAdjacency *gridadj, int totgrid, struct CCGKey *key, void **gridfaces, struct DMFlagMat *flagmats, diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index 1e87b44784e..ec6c9d0604c 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -136,6 +136,7 @@ struct PBVH { /* Mesh data */ MVert *verts; MFace *faces; + CustomData *vdata; /* Grid Data */ CCGKey gridkey; @@ -602,7 +603,7 @@ static void pbvh_build(PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim) } /* Do a full rebuild with on Mesh data structure */ -void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int totvert) +void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int totvert, struct CustomData *vdata) { BBC *prim_bbc = NULL; BB cb; @@ -614,6 +615,7 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int bvh->vert_bitmap = BLI_BITMAP_NEW(totvert, "bvh->vert_bitmap"); bvh->totvert = totvert; bvh->leaf_limit = LEAF_LIMIT; + bvh->vdata = vdata; BB_reset(&cb); |