diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/node_2d.cpp | 20 | ||||
-rw-r--r-- | scene/2d/node_2d.h | 4 | ||||
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 3 | ||||
-rw-r--r-- | scene/2d/tile_map.cpp | 4 | ||||
-rw-r--r-- | scene/3d/light.cpp | 8 | ||||
-rw-r--r-- | scene/3d/physics_body.cpp | 2 | ||||
-rw-r--r-- | scene/3d/spatial.cpp | 18 | ||||
-rw-r--r-- | scene/3d/spatial.h | 4 | ||||
-rw-r--r-- | scene/gui/control.cpp | 14 | ||||
-rw-r--r-- | scene/gui/control.h | 4 | ||||
-rw-r--r-- | scene/main/canvas_layer.cpp | 18 | ||||
-rw-r--r-- | scene/main/canvas_layer.h | 4 | ||||
-rw-r--r-- | scene/resources/capsule_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/circle_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/concave_polygon_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/convex_polygon_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/rectangle_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/segment_shape_2d.cpp | 4 | ||||
-rw-r--r-- | scene/resources/shape_line_2d.cpp | 2 |
19 files changed, 23 insertions, 96 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index e62b59dd4d..b6111e9765 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -155,14 +155,6 @@ void Node2D::set_rotation_in_degrees(float p_degrees) { set_rotation(Math::deg2rad(p_degrees)); } -// Kept for compatibility after rename to set_rotd. -// Could be removed after a couple releases. -void Node2D::_set_rotd(float p_degrees) { - - WARN_PRINT("Deprecated method Node2D._set_rotd(): This method was renamed to set_rotd. Please adapt your code accordingly, as the old method will be obsoleted."); - set_rotation_in_degrees(p_degrees); -} - void Node2D::set_scale(const Size2 &p_scale) { if (_xform_dirty) @@ -182,23 +174,19 @@ Point2 Node2D::get_position() const { ((Node2D *)this)->_update_xform_values(); return pos; } + float Node2D::get_rotation() const { if (_xform_dirty) ((Node2D *)this)->_update_xform_values(); return angle; } + float Node2D::get_rotation_in_degrees() const { return Math::rad2deg(get_rotation()); } -// Kept for compatibility after rename to get_rotd. -// Could be removed after a couple releases. -float Node2D::_get_rotd() const { - WARN_PRINT("Deprecated method Node2D._get_rotd(): This method was renamed to get_rotd. Please adapt your code accordingly, as the old method will be obsoleted."); - return get_rotation_in_degrees(); -} Size2 Node2D::get_scale() const { if (_xform_dirty) ((Node2D *)this)->_update_xform_values(); @@ -410,10 +398,6 @@ Point2 Node2D::to_global(Point2 p_local) const { void Node2D::_bind_methods() { - // TODO: Obsolete those two methods (old name) properly (GH-4397) - ClassDB::bind_method(D_METHOD("_get_rotd"), &Node2D::_get_rotd); - ClassDB::bind_method(D_METHOD("_set_rotd", "degrees"), &Node2D::_set_rotd); - ClassDB::bind_method(D_METHOD("set_position", "position"), &Node2D::set_position); ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Node2D::set_rotation); ClassDB::bind_method(D_METHOD("set_rotation_in_degrees", "degrees"), &Node2D::set_rotation_in_degrees); diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 19aafc81ff..8890c829f8 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -48,10 +48,6 @@ class Node2D : public CanvasItem { void _update_transform(); - // Deprecated, should be removed in a future version. - void _set_rotd(float p_degrees); - float _get_rotd() const; - void _update_xform_values(); protected: diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index f0ee64a53f..1287a800e3 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -133,8 +133,9 @@ bool PhysicsBody2D::get_collision_layer_bit(int p_bit) const { } PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode) - : CollisionObject2D(Physics2DServer::get_singleton()->body_create(p_mode), false) { + : CollisionObject2D(Physics2DServer::get_singleton()->body_create(), false) { + Physics2DServer::get_singleton()->body_set_mode(get_rid(), p_mode); collision_layer = 1; collision_mask = 1; set_pickable(false); diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 4286d88ab1..41097ce8d7 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -587,7 +587,9 @@ Map<TileMap::PosKey, TileMap::Quadrant>::Element *TileMap::_create_quadrant(cons xform.set_origin(q.pos); //q.canvas_item = VisualServer::get_singleton()->canvas_item_create(); - q.body = Physics2DServer::get_singleton()->body_create(use_kinematic ? Physics2DServer::BODY_MODE_KINEMATIC : Physics2DServer::BODY_MODE_STATIC); + q.body = Physics2DServer::get_singleton()->body_create(); + Physics2DServer::get_singleton()->body_set_mode(q.body, use_kinematic ? Physics2DServer::BODY_MODE_KINEMATIC : Physics2DServer::BODY_MODE_STATIC); + Physics2DServer::get_singleton()->body_attach_object_instance_id(q.body, get_instance_id()); Physics2DServer::get_singleton()->body_set_collision_layer(q.body, collision_layer); Physics2DServer::get_singleton()->body_set_collision_mask(q.body, collision_mask); diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 02d10523e7..389d87cd90 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -255,7 +255,13 @@ void Light::_bind_methods() { Light::Light(VisualServer::LightType p_type) { type = p_type; - light = VisualServer::get_singleton()->light_create(p_type); + switch (p_type) { + case VS::LIGHT_DIRECTIONAL: light = VisualServer::get_singleton()->directional_light_create(); break; + case VS::LIGHT_OMNI: light = VisualServer::get_singleton()->omni_light_create(); break; + case VS::LIGHT_SPOT: light = VisualServer::get_singleton()->spot_light_create(); break; + default: {}; + } + VS::get_singleton()->instance_set_base(get_instance(), light); reverse_cull = false; diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index bc089e5b41..4e06b272e2 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -995,7 +995,7 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve Transform gt = get_global_transform(); gt.origin -= collision.travel; set_global_transform(gt); - return floor_velocity; + return floor_velocity - p_floor_direction * p_floor_direction.dot(floor_velocity); } } else if (collision.normal.dot(-p_floor_direction) >= Math::cos(p_floor_max_angle)) { //ceiling on_ceiling = true; diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 0dfd80ca90..bc306481ce 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -332,12 +332,6 @@ void Spatial::set_rotation_in_degrees(const Vector3 &p_euler_deg) { set_rotation(p_euler_deg * Math_PI / 180.0); } -void Spatial::_set_rotation_deg(const Vector3 &p_euler_deg) { - - WARN_PRINT("Deprecated method Spatial._set_rotation_deg(): This method was renamed to set_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted."); - set_rotation_in_degrees(p_euler_deg); -} - void Spatial::set_scale(const Vector3 &p_scale) { if (data.dirty & DIRTY_VECTORS) { @@ -375,14 +369,6 @@ Vector3 Spatial::get_rotation_in_degrees() const { return get_rotation() * 180.0 / Math_PI; } -// Kept for compatibility after rename to set_rotd. -// Could be removed after a couple releases. -Vector3 Spatial::_get_rotation_deg() const { - - WARN_PRINT("Deprecated method Spatial._get_rotation_deg(): This method was renamed to get_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted."); - return get_rotation_in_degrees(); -} - Vector3 Spatial::get_scale() const { if (data.dirty & DIRTY_VECTORS) { @@ -705,10 +691,6 @@ void Spatial::_bind_methods() { ClassDB::bind_method(D_METHOD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel); ClassDB::bind_method(D_METHOD("get_world"), &Spatial::get_world); - // TODO: Obsolete those two methods (old name) properly (GH-4397) - ClassDB::bind_method(D_METHOD("_set_rotation_deg", "rotation_deg"), &Spatial::_set_rotation_deg); - ClassDB::bind_method(D_METHOD("_get_rotation_deg"), &Spatial::_get_rotation_deg); - #ifdef TOOLS_ENABLED ClassDB::bind_method(D_METHOD("_update_gizmo"), &Spatial::_update_gizmo); #endif diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index b912d1f906..afac855de0 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -106,10 +106,6 @@ class Spatial : public Node { void _notify_dirty(); void _propagate_transform_changed(Spatial *p_origin); - // Deprecated, should be removed in a future version. - void _set_rotation_deg(const Vector3 &p_euler_deg); - Vector3 _get_rotation_deg() const; - void _propagate_visibility_changed(); protected: diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 54a58159ac..1f230e95c7 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2424,16 +2424,6 @@ float Control::get_rotation_deg() const { return Math::rad2deg(get_rotation()); } -// Kept for compatibility after rename to {s,g}et_rotation_deg. -// Could be removed after a couple releases. -void Control::_set_rotation_deg(float p_degrees) { - WARN_PRINT("Deprecated method Control._set_rotation_deg(): This method was renamed to set_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted."); - set_rotation_deg(p_degrees); -} -float Control::_get_rotation_deg() const { - WARN_PRINT("Deprecated method Control._get_rotation_deg(): This method was renamed to get_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted."); - return get_rotation_deg(); -} //needed to update the control if the font changes.. void Control::_ref_font(Ref<Font> p_sc) { @@ -2607,8 +2597,6 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("set_global_position", "position"), &Control::set_global_position); ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Control::set_rotation); ClassDB::bind_method(D_METHOD("set_rotation_deg", "degrees"), &Control::set_rotation_deg); - // TODO: Obsolete this method (old name) properly (GH-4397) - ClassDB::bind_method(D_METHOD("_set_rotation_deg", "degrees"), &Control::_set_rotation_deg); ClassDB::bind_method(D_METHOD("set_scale", "scale"), &Control::set_scale); ClassDB::bind_method(D_METHOD("set_pivot_offset", "pivot_offset"), &Control::set_pivot_offset); ClassDB::bind_method(D_METHOD("get_margin", "margin"), &Control::get_margin); @@ -2618,8 +2606,6 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("get_size"), &Control::get_size); ClassDB::bind_method(D_METHOD("get_rotation"), &Control::get_rotation); ClassDB::bind_method(D_METHOD("get_rotation_deg"), &Control::get_rotation_deg); - // TODO: Obsolete this method (old name) properly (GH-4397) - ClassDB::bind_method(D_METHOD("_get_rotation_deg"), &Control::_get_rotation_deg); ClassDB::bind_method(D_METHOD("get_scale"), &Control::get_scale); ClassDB::bind_method(D_METHOD("get_pivot_offset"), &Control::get_pivot_offset); ClassDB::bind_method(D_METHOD("get_custom_minimum_size"), &Control::get_custom_minimum_size); diff --git a/scene/gui/control.h b/scene/gui/control.h index 5b146b4454..8c1df6784a 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -226,10 +226,6 @@ private: void _size_changed(); String _get_tooltip() const; - // Deprecated, should be removed in a future version. - void _set_rotation_deg(float p_degrees); - float _get_rotation_deg() const; - void _ref_font(Ref<Font> p_sc); void _unref_font(Ref<Font> p_sc); void _font_changed(); diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index ce8714e574..f626c567a9 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -115,20 +115,6 @@ real_t CanvasLayer::get_rotationd() const { return Math::rad2deg(get_rotation()); } -// Kept for compatibility after rename to {s,g}et_rotationd. -// Could be removed after a couple releases. -void CanvasLayer::_set_rotationd(real_t p_degrees) { - - WARN_PRINT("Deprecated method CanvasLayer._set_rotationd(): This method was renamed to set_rotationd. Please adapt your code accordingly, as the old method will be obsoleted."); - set_rotationd(p_degrees); -} - -real_t CanvasLayer::_get_rotationd() const { - - WARN_PRINT("Deprecated method CanvasLayer._get_rotationd(): This method was renamed to get_rotationd. Please adapt your code accordingly, as the old method will be obsoleted."); - return get_rotationd(); -} - void CanvasLayer::set_scale(const Vector2 &p_scale) { if (locrotscale_dirty) @@ -255,10 +241,6 @@ void CanvasLayer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_rotationd", "degrees"), &CanvasLayer::set_rotationd); ClassDB::bind_method(D_METHOD("get_rotationd"), &CanvasLayer::get_rotationd); - // TODO: Obsolete those two methods (old name) properly (GH-4397) - ClassDB::bind_method(D_METHOD("_set_rotationd", "degrees"), &CanvasLayer::_set_rotationd); - ClassDB::bind_method(D_METHOD("_get_rotationd"), &CanvasLayer::_get_rotationd); - ClassDB::bind_method(D_METHOD("set_scale", "scale"), &CanvasLayer::set_scale); ClassDB::bind_method(D_METHOD("get_scale"), &CanvasLayer::get_scale); diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index fbee87f487..bb7692de0f 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -54,10 +54,6 @@ class CanvasLayer : public Node { int sort_index; - // Deprecated, should be removed in a future version. - void _set_rotationd(real_t p_degrees); - real_t _get_rotationd() const; - void _update_xform(); void _update_locrotscale(); diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 56a09bc3bf..912150b939 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -98,7 +98,7 @@ void CapsuleShape2D::_bind_methods() { } CapsuleShape2D::CapsuleShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CAPSULE)) { + : Shape2D(Physics2DServer::get_singleton()->capsule_shape_create()) { radius = 10; height = 20; diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index ecfc98ea60..287bde4bfb 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -77,7 +77,7 @@ void CircleShape2D::draw(const RID &p_to_rid, const Color &p_color) { } CircleShape2D::CircleShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CIRCLE)) { + : Shape2D(Physics2DServer::get_singleton()->circle_shape_create()) { radius = 10; _update_shape(); diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index 7f4abf7ae0..bb91e33ec2 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -85,5 +85,5 @@ void ConcavePolygonShape2D::_bind_methods() { } ConcavePolygonShape2D::ConcavePolygonShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CONCAVE_POLYGON)) { + : Shape2D(Physics2DServer::get_singleton()->concave_polygon_shape_create()) { } diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index 7588909d90..a76b6a7cf4 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -87,7 +87,7 @@ Rect2 ConvexPolygonShape2D::get_rect() const { } ConvexPolygonShape2D::ConvexPolygonShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CONVEX_POLYGON)) { + : Shape2D(Physics2DServer::get_singleton()->convex_polygon_shape_create()) { int pcount = 3; for (int i = 0; i < pcount; i++) diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index 507dbce861..69dbb76744 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -67,7 +67,7 @@ void RectangleShape2D::_bind_methods() { } RectangleShape2D::RectangleShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RECTANGLE)) { + : Shape2D(Physics2DServer::get_singleton()->rectangle_shape_create()) { extents = Vector2(10, 10); _update_shape(); diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 1171db5c02..7c7ec0d112 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -87,7 +87,7 @@ void SegmentShape2D::_bind_methods() { } SegmentShape2D::SegmentShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_SEGMENT)) { + : Shape2D(Physics2DServer::get_singleton()->segment_shape_create()) { a = Vector2(); b = Vector2(0, 10); @@ -146,7 +146,7 @@ real_t RayShape2D::get_length() const { } RayShape2D::RayShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RAY)) { + : Shape2D(Physics2DServer::get_singleton()->ray_shape_create()) { length = 20; _update_shape(); diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index 4dcc5ac981..d046ce876c 100644 --- a/scene/resources/shape_line_2d.cpp +++ b/scene/resources/shape_line_2d.cpp @@ -96,7 +96,7 @@ void LineShape2D::_bind_methods() { } LineShape2D::LineShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_LINE)) { + : Shape2D(Physics2DServer::get_singleton()->line_shape_create()) { normal = Vector2(0, -1); d = 0; |