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:
authorCampbell Barton <ideasman42@gmail.com>2009-11-21 19:44:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-21 19:44:05 +0300
commit6f38938a64178f0a3ed6a4b96e4bf459c9076468 (patch)
tree8852c14a73eae4a32b68a78bac1086dd7fc15487 /source/blender/editors/mesh/editmesh_mods.c
parentbd1f548d8e4a47b81b03af3d50339b2fa33ff5fb (diff)
[#19930] Nurb CV select is failing because of view clipping
- the clipping test function was using the rv3d->viewmatob where it needed to use the object matrix. - added a local clipping member to rv3d, the clipping planes in object-space, avoids many matrix multiplications when testing verts or clipping pixels when projection painting.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mods.c')
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index a0df4cb1211..e14dedf6002 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -482,14 +482,17 @@ static void findnearestedge__doClosest(void *userData, EditEdge *eed, int x0, in
struct { ViewContext vc; float mval[2]; int dist; EditEdge *closest; } *data = userData;
float v1[2], v2[2];
int distance;
-
+
+ ED_view3d_local_clipping(data->vc.rv3d, data->vc.obedit->obmat); /* for local clipping lookups */
+
v1[0] = x0;
v1[1] = y0;
v2[0] = x1;
v2[1] = y1;
-
+
distance= dist_to_line_segment_v2(data->mval, v1, v2);
-
+
+
if(eed->f & SELECT) distance+=5;
if(distance < data->dist) {
if(data->vc.rv3d->rflag & RV3D_CLIPPING) {
@@ -499,9 +502,8 @@ static void findnearestedge__doClosest(void *userData, EditEdge *eed, int x0, in
vec[0]= eed->v1->co[0] + labda*(eed->v2->co[0] - eed->v1->co[0]);
vec[1]= eed->v1->co[1] + labda*(eed->v2->co[1] - eed->v1->co[1]);
vec[2]= eed->v1->co[2] + labda*(eed->v2->co[2] - eed->v1->co[2]);
- mul_m4_v3(data->vc.obedit->obmat, vec);
- if(view3d_test_clipping(data->vc.rv3d, vec)==0) {
+ if(view3d_test_clipping(data->vc.rv3d, vec, 1)==0) {
data->dist = distance;
data->closest = eed;
}