diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-11-19 10:41:20 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-11-19 10:41:20 -0300 |
commit | d3eb9e8c54d4a93b2bed90a5988f9814377d409f (patch) | |
tree | a8586037e25eb481fb386745bbcd9a63ced46898 | |
parent | 36d620c633be55ac402892bce816d4a9b4d67bee (diff) |
-remove Vector2.atan2() replaced by Vector2.angle(), fixes #2260
-rw-r--r-- | core/math/math_2d.cpp | 4 | ||||
-rw-r--r-- | core/math/math_2d.h | 2 | ||||
-rw-r--r-- | core/variant_call.cpp | 4 | ||||
-rw-r--r-- | platform/windows/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/windows/export/export.h | 2 | ||||
-rw-r--r-- | scene/2d/node_2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/path_2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/ray_cast_2d.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/body_2d_sw.cpp | 2 | ||||
-rw-r--r-- | tools/editor/io_plugins/editor_scene_import_plugin.cpp | 4 | ||||
-rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/spatial_editor_gizmos.cpp | 2 |
12 files changed, 16 insertions, 16 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index 88717723ce..ce03f089e5 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -29,7 +29,7 @@ #include "math_2d.h" -real_t Vector2::atan2() const { +real_t Vector2::angle() const { return Math::atan2(x,y); } @@ -165,7 +165,7 @@ Vector2 Vector2::floor() const { Vector2 Vector2::rotated(float p_by) const { Vector2 v; - v.set_rotation(atan2()+p_by); + v.set_rotation(angle()+p_by); v*=length(); return v; } diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 5e6cefd114..3d40e24091 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -133,7 +133,7 @@ struct Vector2 { bool operator<(const Vector2& p_vec2) const { return (x==p_vec2.x)?(y<p_vec2.y):(x<p_vec2.x); } bool operator<=(const Vector2& p_vec2) const { return (x==p_vec2.x)?(y<=p_vec2.y):(x<=p_vec2.x); } - real_t atan2() const; + real_t angle() const; void set_rotation(float p_radians) { diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 7bbb18225d..51d683f1fe 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -333,7 +333,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1R(Vector2,dot); VCALL_LOCALMEM1R(Vector2,slide); VCALL_LOCALMEM1R(Vector2,reflect); - VCALL_LOCALMEM0R(Vector2,atan2); + VCALL_LOCALMEM0R(Vector2,angle); // VCALL_LOCALMEM1R(Vector2,cross); VCALL_LOCALMEM0R(Rect2,get_area); @@ -1297,7 +1297,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(VECTOR2,VECTOR2,Vector2,normalized,varray()); ADDFUNC0(VECTOR2,REAL,Vector2,length,varray()); - ADDFUNC0(VECTOR2,REAL,Vector2,atan2,varray()); + ADDFUNC0(VECTOR2,REAL,Vector2,angle,varray()); ADDFUNC0(VECTOR2,REAL,Vector2,length_squared,varray()); ADDFUNC1(VECTOR2,REAL,Vector2,distance_to,VECTOR2,"to",varray()); ADDFUNC1(VECTOR2,REAL,Vector2,distance_squared_to,VECTOR2,"to",varray()); diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index d09152234a..29f21bf227 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -197,9 +197,9 @@ void EditorExportPlatformWindows::_get_property_list( List<PropertyInfo> *p_list } -Error EditorExportPlatformWindows::export_project(const String& p_path, bool p_debug, bool p_dumb,bool p_remote_debug) { +Error EditorExportPlatformWindows::export_project(const String& p_path, bool p_debug, int p_flags) { - Error err = EditorExportPlatformPC::export_project(p_path, p_debug, p_dumb, p_remote_debug); + Error err = EditorExportPlatformPC::export_project(p_path, p_debug, p_flags); if(err != OK) { return err; diff --git a/platform/windows/export/export.h b/platform/windows/export/export.h index 702acc04b2..2424efc861 100644 --- a/platform/windows/export/export.h +++ b/platform/windows/export/export.h @@ -29,7 +29,7 @@ protected: void _get_property_list( List<PropertyInfo> *p_list) const; public: - Error export_project(const String& p_path, bool p_debug, bool p_dumb=false, bool p_remote_debug=false); + Error export_project(const String& p_path, bool p_debug,int p_flags=0); EditorExportPlatformWindows(); }; diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 6141b6a09e..52b112f090 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -354,7 +354,7 @@ void Node2D::look_at(const Vector2& p_pos) { float Node2D::get_angle_to(const Vector2& p_pos) const { - return (get_global_transform().affine_inverse().xform(p_pos)).atan2(); + return (get_global_transform().affine_inverse().xform(p_pos)).angle(); } void Node2D::_bind_methods() { diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 7ba1bb28b6..8f110b3931 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -118,7 +118,7 @@ void PathFollow2D::_update_transform() { pos+=n*h_offset; pos+=t*v_offset; - set_rot(t.atan2()); + set_rot(t.angle()); } else { diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index acc4c620e6..4a199e3418 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -131,7 +131,7 @@ void RayCast2D::_notification(int p_what) { if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) break; Matrix32 xf; - xf.rotate(cast_to.atan2()); + xf.rotate(cast_to.angle()); xf.translate(Vector2(0,cast_to.length())); //Vector2 tip = Vector2(0,s->get_length()); diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 38835c9a82..3afbbe5455 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -442,7 +442,7 @@ void Body2DSW::integrate_forces(real_t p_step) { //compute motion, angular and etc. velocities from prev transform linear_velocity = (new_transform.elements[2] - get_transform().elements[2])/p_step; - real_t rot = new_transform.affine_inverse().basis_xform(get_transform().elements[1]).atan2(); + real_t rot = new_transform.affine_inverse().basis_xform(get_transform().elements[1]).angle(); angular_velocity = rot / p_step; motion = new_transform.elements[2] - get_transform().elements[2]; diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 99dcf4ed28..ca44df269b 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -1814,8 +1814,8 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> for(int i=0;i<portal_points.size()-1;i++) { - float a = portal_points[i].atan2(); - float b = portal_points[i+1].atan2(); + float a = portal_points[i].angle(); + float b = portal_points[i+1].angle(); if (a>b) { SWAP( portal_points[i], portal_points[i+1] ); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 90bfe0bfdf..fbc41a7269 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -1488,7 +1488,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { Matrix32 rot; rot.elements[1] = (dfrom - center).normalized(); rot.elements[0] = rot.elements[1].tangent(); - node->set_rot(snap_angle(rot.xform_inv(dto-center).atan2(), node->get_rot())); + node->set_rot(snap_angle(rot.xform_inv(dto-center).angle(), node->get_rot())); display_rotate_to = dto; display_rotate_from = center; viewport->update(); diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 4dc9c4f43e..5efca44c7d 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -745,7 +745,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); - float a = Vector2(min_p.x,-min_p.z).atan2(); + float a = Vector2(min_p.x,-min_p.z).angle(); return a*180.0/Math_PI; } |