3DEditorGizmo: fix spotlight and camera gizmo & handle

This commit is contained in:
Poommetee Ketson 2017-10-02 10:59:39 +07:00
parent d3345121cc
commit 520467376b

View file

@ -744,7 +744,7 @@ static float _find_closest_angle_to_half_pi_arc(const Vector3 &p_from, const Vec
} }
//min_p = p_arc_xform.affine_inverse().xform(min_p); //min_p = p_arc_xform.affine_inverse().xform(min_p);
float a = Vector2(min_p.x, -min_p.z).angle(); float a = (Math_PI * 0.5) - Vector2(min_p.x, -min_p.z).angle();
return a * 180.0 / Math_PI; return a * 180.0 / Math_PI;
} }
@ -893,7 +893,7 @@ void LightSpatialGizmo::redraw() {
if (Object::cast_to<SpotLight>(light)) { if (Object::cast_to<SpotLight>(light)) {
Ref<Material> material = create_material("light_spot_material", gizmo_color, true); Ref<Material> material = create_material("light_spot_material", gizmo_color);
Ref<Material> icon = create_icon_material("light_spot_icon", SpatialEditor::get_singleton()->get_icon("GizmoSpotLight", "EditorIcons")); Ref<Material> icon = create_icon_material("light_spot_icon", SpatialEditor::get_singleton()->get_icon("GizmoSpotLight", "EditorIcons"));
clear(); clear();