bugfix [#20401] Hair Combing with "Limit Selection to Visible" does not comb all particles

Limit selection was totally broken (border select, circle select etc) because the depth function was using the view matrix multiplied by the object matrix.
I couldnt find any case where this was needed, but take care when using data->mats.modelview from particle mode edit tools.
This commit is contained in:
Campbell Barton
2010-01-26 11:51:28 +00:00
parent 38111eb224
commit 8f6ce8c2d3

View File

@@ -374,7 +374,8 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
PE_set_data(C, data);
view3d_set_viewcontext(C, &data->vc);
view3d_get_transformation(data->vc.ar, data->vc.rv3d, data->ob, &data->mats);
/* note, the object argument means the modelview matrix does not account for the objects matrix, use viewmat rather then (obmat * viewmat) */
view3d_get_transformation(data->vc.ar, data->vc.rv3d, NULL, &data->mats);
if((data->vc.v3d->drawtype>OB_WIRE) && (data->vc.v3d->flag & V3D_ZBUF_SELECT))
view3d_validate_backbuf(&data->vc);
@@ -407,7 +408,8 @@ static int key_test_depth(PEData *data, float co[3])
x+= (short)data->vc.ar->winrct.xmin;
y+= (short)data->vc.ar->winrct.ymin;
view3d_validate_backbuf(&data->vc);
/* PE_set_view3d_data calls this. no need to call here */
/* view3d_validate_backbuf(&data->vc); */
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
if((float)uz - 0.0001 > depth)