Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-03-14 10:32:03 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-03-14 10:32:03 +0400
commit521e724eddc9bfcc3f4aaeac184ae6974bb922a4 (patch)
tree659791e83846e89bd0b5e7866e639e2e9fcd8a44 /source/blender/blenlib/intern
parent8717e35db3b4b267198e07f2d461348458a33282 (diff)
Skip hidden elements in PBVH iterator, raycast, and drawing.
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/pbvh.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 952a3df7109..a986896e0d2 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -141,6 +141,7 @@ struct PBVH {
const DMFlagMat *grid_flag_mats;
int totgrid;
int gridsize;
+ BLI_bitmap *grid_hidden;
/* Only used during BVH build and update,
* don't need to remain valid after */
@@ -639,7 +640,7 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int
/* Do a full rebuild with on Grids data structure */
void BLI_pbvh_build_grids(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridadj,
- int totgrid, int gridsize, void **gridfaces, DMFlagMat *flagmats)
+ int totgrid, int gridsize, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap *grid_hidden)
{
BBC *prim_bbc = NULL;
BB cb;
@@ -652,6 +653,7 @@ void BLI_pbvh_build_grids(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridad
bvh->grid_flag_mats= flagmats;
bvh->totgrid= totgrid;
bvh->gridsize= gridsize;
+ bvh->grid_hidden= grid_hidden;
bvh->leaf_limit = MAX2(LEAF_LIMIT/((gridsize-1)*(gridsize-1)), 1);
BB_reset(&cb);
@@ -1284,6 +1286,12 @@ PBVHType BLI_pbvh_type(const PBVH *bvh)
return bvh->type;
}
+BLI_bitmap *BLI_pbvh_grid_hidden(const PBVH *bvh)
+{
+ BLI_assert(bvh->type == PBVH_GRIDS);
+ return bvh->grid_hidden;
+}
+
/***************************** Node Access ***********************************/
void BLI_pbvh_node_mark_update(PBVHNode *node)