diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-12-02 10:08:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-12-02 10:08:48 +0300 |
commit | a5c0964c70cc4c12e574ef7e51fcf6c0b5f38680 (patch) | |
tree | 294c583784a171dcc4cff46ea1a3e034f61960df /source/blender/editors/space_view3d/view3d_walk.c | |
parent | 8d8bc24dd501511a1a8adfb011cd3dc447ff77e4 (diff) |
Cleanup: transform snap arguments
This was getting very hard to follow,
- mixing input/output args.
- mixing arg order between functions.
- arg names (mode, snap_mode) rename to (snap_to, snap_select)
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_walk.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_walk.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 4d36d703ae7..b71b6b86356 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -403,7 +403,6 @@ static void walk_navigation_mode_set(bContext *C, wmOperator *op, WalkInfo *walk */ static bool walk_floor_distance_get(bContext *C, RegionView3D *rv3d, WalkInfo *walk, const float dvec[3], float *r_distance) { - float dummy_dist_px = 0; float ray_normal[3] = {0, 0, -1}; /* down */ float ray_start[3]; float r_location[3]; @@ -418,10 +417,12 @@ static bool walk_floor_distance_get(bContext *C, RegionView3D *rv3d, WalkInfo *w mul_v3_v3fl(dvec_tmp, dvec, walk->grid); add_v3_v3(ray_start, dvec_tmp); - ret = snapObjectsRayEx(CTX_data_scene(C), NULL, NULL, NULL, NULL, SCE_SNAP_MODE_FACE, - NULL, NULL, - ray_start, ray_normal, r_distance, - NULL, &dummy_dist_px, r_location, r_normal, SNAP_ALL); + ret = snapObjectsRayEx( + CTX_data_scene(C), NULL, NULL, NULL, NULL, + NULL, SNAP_ALL, SCE_SNAP_MODE_FACE, + ray_start, ray_normal, r_distance, + r_location, r_normal, NULL, + NULL, NULL); /* artifically scale the distance to the scene size */ *r_distance /= walk->grid; @@ -435,7 +436,6 @@ static bool walk_floor_distance_get(bContext *C, RegionView3D *rv3d, WalkInfo *w */ static bool walk_ray_cast(bContext *C, RegionView3D *rv3d, WalkInfo *walk, float r_location[3], float r_normal[3], float *ray_distance) { - float dummy_dist_px = 0; float ray_normal[3] = {0, 0, 1}; /* forward */ float ray_start[3]; float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */ @@ -451,10 +451,12 @@ static bool walk_ray_cast(bContext *C, RegionView3D *rv3d, WalkInfo *walk, float mul_v3_fl(ray_normal, -1); normalize_v3(ray_normal); - ret = snapObjectsRayEx(CTX_data_scene(C), NULL, NULL, NULL, NULL, SCE_SNAP_MODE_FACE, - NULL, NULL, - ray_start, ray_normal, ray_distance, - NULL, &dummy_dist_px, r_location, r_normal, SNAP_ALL); + ret = snapObjectsRayEx( + CTX_data_scene(C), NULL, NULL, NULL, NULL, + NULL, SNAP_ALL, SCE_SNAP_MODE_FACE, + ray_start, ray_normal, ray_distance, + r_location, r_normal, NULL, + NULL, NULL); /* dot is positive if both rays are facing the same direction */ |