diff options
| author | JFonS <joan.fonssanchez@gmail.com> | 2018-08-11 23:07:00 +0200 |
|---|---|---|
| committer | JFonS <joan.fonssanchez@gmail.com> | 2018-08-11 23:07:00 +0200 |
| commit | ac51da2eb65986fbc9d3d2316ee4aac4d4663d67 (patch) | |
| tree | cdf6b45ac97b97a3dd21caa1578ca590a08922a0 /editor/spatial_editor_gizmos.cpp | |
| parent | b9730a695643af15bd97f9b87ae656b735281bba (diff) | |
| download | redot-engine-ac51da2eb65986fbc9d3d2316ee4aac4d4663d67.tar.gz | |
Improvements on the gizmo disabling menu and icon selection bugfix
Diffstat (limited to 'editor/spatial_editor_gizmos.cpp')
| -rw-r--r-- | editor/spatial_editor_gizmos.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index b0505eebda..64fdc778d0 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -48,7 +48,7 @@ // It's so ugly it will eat them alive // The previous comment is kept only for historical reasons. -// No children will be harmed by the visioning of this file... hopefully. +// No children will be harmed by the viewing of this file... hopefully. #define HANDLE_HALF_SIZE 9.5 @@ -531,6 +531,8 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point, rect.set_position(center - rect.get_size() / 2.0); if (rect.has_point(p_point)) { + r_pos = t.origin; + r_normal = -p_camera->project_ray_normal(p_point); return true; } @@ -1472,34 +1474,6 @@ void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->clear(); Ref<Material> material = get_material("skeleton_material", p_gizmo); - SpatialMaterial *sm = Object::cast_to<SpatialMaterial>(material.ptr()); - - { // Reset - Color c(sm->get_albedo()); - c.a = 1; - sm->set_albedo(c); - } - if (sm) { - switch (SpatialEditor::get_singleton()->get_skeleton_visibility_state()) { - case 0: { - // Hidden - Color c(sm->get_albedo()); - c.a = 0; - sm->set_albedo(c); - sm->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); - } break; - case 1: - // Visible - sm->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, false); - sm->set_render_priority(SpatialMaterial::RENDER_PRIORITY_MIN); - sm->set_flag(SpatialMaterial::FLAG_DISABLE_DEPTH_TEST, false); - break; - case 2: - // x-ray - sm->set_on_top_of_alpha(); - break; - } - } Ref<SurfaceTool> surface_tool(memnew(SurfaceTool)); |
