diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-11-15 08:17:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-15 08:17:55 +0100 |
commit | 635db806c4e37a28ae4df055809fff8667637dc6 (patch) | |
tree | 4e0c0323f905488da9c68bd06cf8bc9f33e30cbf | |
parent | 394d48a5fc287e5422a937ecfd5b9197ec2ad3ff (diff) | |
parent | 4d1acab79b0e284252d1aa3fa0447f8fbc4c5a7d (diff) |
Merge pull request #7115 from sketchyfun/path3D_handle_snap
Added snapping to 3D path handles
-rw-r--r-- | tools/editor/plugins/path_editor_plugin.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp index 33ef71efab..258e92dc41 100644 --- a/tools/editor/plugins/path_editor_plugin.cpp +++ b/tools/editor/plugins/path_editor_plugin.cpp @@ -103,6 +103,12 @@ void PathSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_po if (p.intersects_ray(ray_from,ray_dir,&inters)) { + if(SpatialEditor::get_singleton()->is_snap_enabled()) + { + float snap = SpatialEditor::get_singleton()->get_translate_snap(); + inters.snap(snap); + } + Vector3 local = gi.xform(inters); c->set_point_pos(p_idx,local); } |