From 53d5761c94b3ff561ecfd1edd0c97ffde62f0215 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 20 May 2011 13:09:34 +0000 Subject: function rename to give clearer meaning that they change from window to 3d coordinates. some functions had vague names, I even ended up re-writing some of these functions by accident! also added doxy comments. * ED_view3d_win_to_3d (was window_to_3d) * ED_view3d_win_to_delta (was window_to_3d_delta) * ED_view3d_win_to_vector (was window_to_3d_vector / viewvector) * ED_view3d_win_to_segment_clip (was viewline) * ED_view3d_win_to_ray (was viewray) --- source/blender/editors/sculpt_paint/paint_image.c | 2 +- source/blender/editors/sculpt_paint/paint_stroke.c | 2 +- source/blender/editors/sculpt_paint/paint_utils.c | 2 +- source/blender/editors/sculpt_paint/sculpt.c | 11 +++++------ 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 1408647d1cb..dbae9bcf1aa 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5270,7 +5270,7 @@ static int set_clone_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event) view3d_operator_needs_opengl(C); - if(!view_autodist(scene, ar, v3d, event->mval, location)) + if(!ED_view3d_autodist(scene, ar, v3d, event->mval, location)) return OPERATOR_CANCELLED; RNA_float_set_array(op->ptr, "location", location); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index e7b62505417..58c3446673c 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -333,7 +333,7 @@ static int project_brush_radius(RegionView3D* rv3d, float radius, float location { float view[3], nonortho[3], ortho[3], offset[3], p1[2], p2[2]; - viewvector(rv3d, location, view); + ED_view3d_global_to_vector(rv3d, location, view); // create a vector that is not orthogonal to view diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index ad85a4bf29b..86b946f6ee3 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -62,7 +62,7 @@ float paint_calc_object_space_radius(ViewContext *vc, float center[3], mul_v3_m4v3(loc, ob->obmat, center); initgrabz(vc->rv3d, loc[0], loc[1], loc[2]); - window_to_3d_delta(vc->ar, delta, pixel_radius, 0); + ED_view3d_win_to_delta(vc->ar, pixel_radius, 0, delta); scale= fabsf(mat4_to_scale(ob->obmat)); scale= (scale == 0.0f)? 1.0f: scale; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 09e46119dbe..7b09736ca95 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -912,7 +912,7 @@ static void calc_sculpt_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **n { switch (brush->sculpt_plane) { case SCULPT_DISP_DIR_VIEW: - viewvector(ss->cache->vc->rv3d, ss->cache->vc->rv3d->twmat[3], an); + ED_view3d_global_to_vector(ss->cache->vc->rv3d, ss->cache->vc->rv3d->twmat[3], an); break; case SCULPT_DISP_DIR_X: @@ -1823,7 +1823,7 @@ static void calc_sculpt_plane(Sculpt *sd, Object *ob, PBVHNode **nodes, int totn { switch (brush->sculpt_plane) { case SCULPT_DISP_DIR_VIEW: - viewvector(ss->cache->vc->rv3d, ss->cache->vc->rv3d->twmat[3], an); + ED_view3d_global_to_vector(ss->cache->vc->rv3d, ss->cache->vc->rv3d->twmat[3], an); break; case SCULPT_DISP_DIR_X: @@ -2926,7 +2926,7 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio cache->mats = MEM_callocN(sizeof(bglMats), "sculpt bglMats"); view3d_get_transformation(vc->ar, vc->rv3d, vc->obact, cache->mats); - viewvector(cache->vc->rv3d, cache->vc->rv3d->twmat[3], cache->true_view_normal); + ED_view3d_global_to_vector(cache->vc->rv3d, cache->vc->rv3d->twmat[3], cache->true_view_normal); /* Initialize layer brush displacements and persistent coords */ if(brush->sculpt_tool == SCULPT_TOOL_LAYER) { /* not supported yet for multires */ @@ -2994,8 +2994,7 @@ static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush) cache->orig_grab_location[1], cache->orig_grab_location[2]); - window_to_3d_delta(cache->vc->ar, grab_location, - cache->mouse[0], cache->mouse[1]); + ED_view3d_win_to_delta(cache->vc->ar, cache->mouse[0], cache->mouse[1], grab_location); /* compute delta to move verts by */ if(!cache->first_time) { @@ -3247,7 +3246,7 @@ int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float ou sculpt_stroke_modifiers_check(C, ob); - viewline(vc->ar, vc->v3d, mval, ray_start, ray_end); + ED_view3d_win_to_segment_clip(vc->ar, vc->v3d, mval, ray_start, ray_end); invert_m4_m4(obimat, ob->obmat); mul_m4_v3(obimat, ray_start); -- cgit v1.2.3