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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-11 19:59:09 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-11 19:59:09 +0300
commitcb4d9a7427e28f360dc168fab225e24c343dc10e (patch)
treef41ecc32910e23f6caf64d65d97772f16d45dc7e /source/blender/blenlib/BLI_pbvh.h
parent026364dcca6539c4e3ad6a5010cba81e61638ef2 (diff)
Sculpt:
* Temporary workaround for sculpt not working well with small polygons, still seems to be some issues, but can at least paint now. * Small optimization avoiding local function variable aliasing.
Diffstat (limited to 'source/blender/blenlib/BLI_pbvh.h')
-rw-r--r--source/blender/blenlib/BLI_pbvh.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index 12c13de183c..148d9507c14 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -100,6 +100,8 @@ void BLI_pbvh_node_get_grids(PBVH *bvh, PBVHNode *node,
struct DMGridData ***griddata, struct DMGridAdjacency **gridadj);
void BLI_pbvh_node_num_verts(PBVH *bvh, PBVHNode *node,
int *uniquevert, int *totvert);
+void BLI_pbvh_node_get_verts(PBVH *bvh, PBVHNode *node,
+ int **vert_indices, struct MVert **verts);
void BLI_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3]);
void BLI_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max[3]);
@@ -149,11 +151,30 @@ typedef struct PBVHVertexIter {
float *fno;
} PBVHVertexIter;
-void BLI_pbvh_node_verts_iter_init(PBVH *bvh, PBVHNode *node, PBVHVertexIter *vi, int mode);
-
#define BLI_pbvh_vertex_iter_begin(bvh, node, vi, mode) \
- /* XXX breaks aliasing! */ \
- BLI_pbvh_node_verts_iter_init(bvh, node, &vi, mode); \
+ { \
+ struct DMGridData **grids; \
+ struct MVert *verts; \
+ int *grid_indices, totgrid, gridsize, *vert_indices, uniq_verts, totvert; \
+ \
+ memset(&vi, 0, sizeof(PBVHVertexIter)); \
+ \
+ BLI_pbvh_node_get_grids(bvh, node, &grid_indices, &totgrid, NULL, &gridsize, &grids, NULL); \
+ BLI_pbvh_node_num_verts(bvh, node, &uniq_verts, &totvert); \
+ BLI_pbvh_node_get_verts(bvh, node, &vert_indices, &verts); \
+ \
+ vi.grids= grids; \
+ vi.grid_indices= grid_indices; \
+ vi.totgrid= (grids)? totgrid: 1; \
+ vi.gridsize= gridsize; \
+ \
+ if(mode == PBVH_ITER_ALL) \
+ vi.totvert = totvert; \
+ else \
+ vi.totvert= uniq_verts; \
+ vi.vert_indices= vert_indices; \
+ vi.mverts= verts; \
+ }\
\
for(vi.i=0, vi.g=0; vi.g<vi.totgrid; vi.g++) { \
if(vi.grids) { \