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-16 22:19:08 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-16 22:19:08 +0300
commit5e48ab8d75bd5ce3085a9de183f36107f6d5d616 (patch)
treedd93878d1daa80aaa1984b989a081dadedebdd11 /source/blender/blenlib
parentfabb36a98af27aa5353c9c968ca7df3f7c134a77 (diff)
Sculpt:
* Increase epsilon for intersection a bit more, ortho view + small faces are problematic. * Fix a redraw issue with one partial redraw too much at the end of the stroke.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/math_geom.c11
-rw-r--r--source/blender/blenlib/intern/pbvh.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 75c32c5b45b..3e714b384a7 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -474,14 +474,15 @@ int isect_ray_tri_epsilon_v3(float p1[3], float d[3], float v0[3], float v1[3],
sub_v3_v3v3(s, p1, v0);
cross_v3_v3v3(q, s, e1);
- *lambda = f * dot_v3v3(e2, q);
- if ((*lambda < 0.0)) return 0;
-
+
u = f * dot_v3v3(s, p);
- if ((u < -epsilon)||(u > 1.0+epsilon)) return 0;
+ if ((u < -epsilon)||(u > 1.0f+epsilon)) return 0;
v = f * dot_v3v3(d, q);
- if ((v < -epsilon)||((u + v) > 1.0+epsilon)) return 0;
+ if ((v < -epsilon)||((u + v) > 1.0f+epsilon)) return 0;
+
+ *lambda = f * dot_v3v3(e2, q);
+ if ((*lambda < 0.0f)) return 0;
if(uv) {
uv[0]= u;
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index d8e3fe4b0be..ff68e3b0881 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -1142,7 +1142,7 @@ static int ray_face_intersection(float ray_start[3], float ray_normal[3],
float dist = FLT_MAX;
if(!isect_ray_tri_epsilon_v3(ray_start, ray_normal, t0, t1, t2,
- &dist, NULL, 0.001f))
+ &dist, NULL, 0.1f))
dist = FLT_MAX;
if(dist >= 0 && dist < *fdist) {