Extrude Widget: with/without axis constraint
[blender.git] / source / blender / editors / transform / transform_snap_object.c
index b6b7e1575911806158945f6eea6c3b1e8d1699ba..40b714100149d4a4f7afe67ae584940b85b2cf4c 100644 (file)
@@ -450,7 +450,7 @@ static bool raycastDerivedMesh(
                }
 
                if (treedata->tree == NULL) {
                }
 
                if (treedata->tree == NULL) {
-                       bvhtree_from_mesh_looptri(treedata, dm, 0.0f, 4, 6);
+                       bvhtree_from_mesh_get(treedata, dm, BVHTREE_FROM_LOOPTRI, 4);
 
                        if (treedata->tree == NULL) {
                                return retval;
 
                        if (treedata->tree == NULL) {
                                return retval;
@@ -1694,10 +1694,10 @@ static bool snapDerivedMesh(
                if (treedata->tree == NULL) {
                        switch (snapdata->snap_to) {
                                case SCE_SNAP_MODE_EDGE:
                if (treedata->tree == NULL) {
                        switch (snapdata->snap_to) {
                                case SCE_SNAP_MODE_EDGE:
-                                       bvhtree_from_mesh_edges(treedata, dm, 0.0f, 2, 6);
+                                       bvhtree_from_mesh_get(treedata, dm, BVHTREE_FROM_EDGES, 2);
                                        break;
                                case SCE_SNAP_MODE_VERTEX:
                                        break;
                                case SCE_SNAP_MODE_VERTEX:
-                                       bvhtree_from_mesh_verts(treedata, dm, 0.0f, 2, 6);
+                                       bvhtree_from_mesh_get(treedata, dm, BVHTREE_FROM_VERTS, 2);
                                        break;
                        }
                }
                                        break;
                        }
                }
@@ -2356,7 +2356,8 @@ bool ED_transform_snap_object_project_view3d_ex(
         const struct SnapObjectParams *params,
         const float mval[2], float *dist_px,
         float *ray_depth,
         const struct SnapObjectParams *params,
         const float mval[2], float *dist_px,
         float *ray_depth,
-        float r_loc[3], float r_no[3], int *r_index)
+        float r_loc[3], float r_no[3], int *r_index,
+        Object **r_ob, float r_obmat[4][4])
 {
        float ray_origin[3], ray_start[3], ray_normal[3], depth_range[2], ray_end[3];
 
 {
        float ray_origin[3], ray_start[3], ray_normal[3], depth_range[2], ray_end[3];
 
@@ -2389,7 +2390,7 @@ bool ED_transform_snap_object_project_view3d_ex(
                        sctx,
                        ray_start, ray_normal,
                        params->snap_select, params->use_object_edit_cage,
                        sctx,
                        ray_start, ray_normal,
                        params->snap_select, params->use_object_edit_cage,
-                       ray_depth, r_loc, r_no, r_index, NULL, NULL, NULL);
+                       ray_depth, r_loc, r_no, r_index, r_ob, r_obmat, NULL);
        }
        else {
                SnapData snapdata;
        }
        else {
                SnapData snapdata;
@@ -2400,7 +2401,7 @@ bool ED_transform_snap_object_project_view3d_ex(
                return snapObjectsRay(
                        sctx, &snapdata,
                        params->snap_select, params->use_object_edit_cage,
                return snapObjectsRay(
                        sctx, &snapdata,
                        params->snap_select, params->use_object_edit_cage,
-                       ray_depth, dist_px, r_loc, r_no, NULL, NULL);
+                       ray_depth, dist_px, r_loc, r_no, r_ob, r_obmat);
        }
 }
 
        }
 }
 
@@ -2418,7 +2419,8 @@ bool ED_transform_snap_object_project_view3d(
                params,
                mval, dist_px,
                ray_depth,
                params,
                mval, dist_px,
                ray_depth,
-               r_loc, r_no, NULL);
+               r_loc, r_no, NULL,
+               NULL, NULL);
 }
 
 /**
 }
 
 /**