diff options
Diffstat (limited to 'servers/physics_2d/shape_2d_sw.cpp')
-rw-r--r-- | servers/physics_2d/shape_2d_sw.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 064c4afe52..b5953bfdaf 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -75,11 +75,6 @@ const Map<ShapeOwner2DSW *, int> &Shape2DSW::get_owners() const { return owners; } -Shape2DSW::Shape2DSW() { - custom_bias = 0; - configured = false; -} - Shape2DSW::~Shape2DSW() { ERR_FAIL_COND(owners.size()); } @@ -88,15 +83,15 @@ Shape2DSW::~Shape2DSW() { /*********************************************************/ /*********************************************************/ -void WorldMarginShape2DSW::get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const { +void WorldBoundaryShape2DSW::get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const { r_amount = 0; } -bool WorldMarginShape2DSW::contains_point(const Vector2 &p_point) const { +bool WorldBoundaryShape2DSW::contains_point(const Vector2 &p_point) const { return normal.dot(p_point) < d; } -bool WorldMarginShape2DSW::intersect_segment(const Vector2 &p_begin, const Vector2 &p_end, Vector2 &r_point, Vector2 &r_normal) const { +bool WorldBoundaryShape2DSW::intersect_segment(const Vector2 &p_begin, const Vector2 &p_end, Vector2 &r_point, Vector2 &r_normal) const { Vector2 segment = p_begin - p_end; real_t den = normal.dot(segment); @@ -118,11 +113,11 @@ bool WorldMarginShape2DSW::intersect_segment(const Vector2 &p_begin, const Vecto return true; } -real_t WorldMarginShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { +real_t WorldBoundaryShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { return 0; } -void WorldMarginShape2DSW::set_data(const Variant &p_data) { +void WorldBoundaryShape2DSW::set_data(const Variant &p_data) { ERR_FAIL_COND(p_data.get_type() != Variant::ARRAY); Array arr = p_data; ERR_FAIL_COND(arr.size() != 2); @@ -131,7 +126,7 @@ void WorldMarginShape2DSW::set_data(const Variant &p_data) { configure(Rect2(Vector2(-1e4, -1e4), Vector2(1e4 * 2, 1e4 * 2))); } -Variant WorldMarginShape2DSW::get_data() const { +Variant WorldBoundaryShape2DSW::get_data() const { Array arr; arr.resize(2); arr[0] = normal; @@ -652,11 +647,6 @@ Variant ConvexPolygonShape2DSW::get_data() const { return dvr; } -ConvexPolygonShape2DSW::ConvexPolygonShape2DSW() { - points = nullptr; - point_count = 0; -} - ConvexPolygonShape2DSW::~ConvexPolygonShape2DSW() { if (points) { memdelete_arr(points); |