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 17:16:17 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-11 17:16:17 +0300
commitc6ffe237629b771f86eb92c755b0897e3a2233e0 (patch)
tree19d6a7a18e49e438262ac686893e20c3871ac222 /source/blender/blenlib
parent89b6d94e387d4b127dfa7095146b641053a01617 (diff)
Sculpt Branch:
* Added detection if VBO extension is supported. * Redraw other 3d views after sculpting. * Fix brush sometimes punching through mesh with very small polygons, added an extra epsilon to the ray-triangle intersection.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_pbvh.h6
-rw-r--r--source/blender/blenlib/intern/pbvh.c28
2 files changed, 14 insertions, 20 deletions
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index e1e733c91df..12c13de183c 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -88,9 +88,9 @@ typedef enum {
PBVH_UpdateNormals = 2,
PBVH_UpdateBB = 4,
- PBVH_UpdateOriginalBB = 4,
- PBVH_UpdateDrawBuffers = 8,
- PBVH_UpdateRedraw = 16
+ PBVH_UpdateOriginalBB = 8,
+ PBVH_UpdateDrawBuffers = 16,
+ PBVH_UpdateRedraw = 32
} PBVHNodeFlags;
void BLI_pbvh_node_mark_update(PBVHNode *node);
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 960888260ce..f0464438b68 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -1142,8 +1142,8 @@ static int ray_face_intersection(float ray_start[3], float ray_normal[3],
{
float dist = FLT_MAX;
- if(!isect_ray_tri_v3(ray_start, ray_normal, t0, t1, t2,
- &dist, NULL))
+ if(!isect_ray_tri_threshold_v3(ray_start, ray_normal, t0, t1, t2,
+ &dist, NULL, 0.001f))
dist = FLT_MAX;
if(dist >= 0 && dist < *fdist) {
@@ -1232,32 +1232,26 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
return hit;
}
-#if 0
-static int nodes_drawn = 0;
-static int is_partial = 0;
-/* XXX: Just a temporary replacement for the real drawing code */
-static void draw_partial_cb(PBVHNode *node, void *data)
+//#include <GL/glew.h>
+void BLI_pbvh_node_draw(PBVHNode *node, void *data)
+{
+#if 0
/* XXX: Just some quick code to show leaf nodes in different colors */
- /*float col[3]; int i;
- if(is_partial) {
+ float col[3]; int i;
+
+ if(0) { //is_partial) {
col[0] = (rand() / (float)RAND_MAX); col[1] = col[2] = 0.6;
}
else {
- srand((long long)data_v);
+ srand((long long)node);
for(i = 0; i < 3; ++i)
col[i] = (rand() / (float)RAND_MAX) * 0.3 + 0.7;
}
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, col);
- glColor3f(1, 0, 0);*/
- GPU_draw_buffers(BLI_pbvh_node_get_draw_buffers(node));
- ++nodes_drawn;
-}
+ glColor3f(1, 0, 0);
#endif
-
-void BLI_pbvh_node_draw(PBVHNode *node, void *data)
-{
GPU_draw_buffers(node->draw_buffers);
}