summaryrefslogtreecommitdiff
path: root/scene/resources/shape_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/shape_2d.cpp')
-rw-r--r--scene/resources/shape_2d.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp
index 4fe585053a..b48de1aeb3 100644
--- a/scene/resources/shape_2d.cpp
+++ b/scene/resources/shape_2d.cpp
@@ -31,23 +31,19 @@
#include "shape_2d.h"
#include "servers/physics_server_2d.h"
RID Shape2D::get_rid() const {
-
return shape;
}
void Shape2D::set_custom_solver_bias(real_t p_bias) {
-
custom_bias = p_bias;
PhysicsServer2D::get_singleton()->shape_set_custom_solver_bias(shape, custom_bias);
}
real_t Shape2D::get_custom_solver_bias() const {
-
return custom_bias;
}
bool Shape2D::collide_with_motion(const Transform2D &p_local_xform, const Vector2 &p_local_motion, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform, const Vector2 &p_shape_motion) {
-
ERR_FAIL_COND_V(p_shape.is_null(), false);
int r;
return PhysicsServer2D::get_singleton()->shape_collide(get_rid(), p_local_xform, p_local_motion, p_shape->get_rid(), p_shape_xform, p_shape_motion, nullptr, 0, r);
@@ -60,7 +56,6 @@ bool Shape2D::collide(const Transform2D &p_local_xform, const Ref<Shape2D> &p_sh
}
Array Shape2D::collide_with_motion_and_get_contacts(const Transform2D &p_local_xform, const Vector2 &p_local_motion, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform, const Vector2 &p_shape_motion) {
-
ERR_FAIL_COND_V(p_shape.is_null(), Array());
const int max_contacts = 16;
Vector2 result[max_contacts * 2];
@@ -78,7 +73,6 @@ Array Shape2D::collide_with_motion_and_get_contacts(const Transform2D &p_local_x
return results;
}
Array Shape2D::collide_and_get_contacts(const Transform2D &p_local_xform, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform) {
-
ERR_FAIL_COND_V(p_shape.is_null(), Array());
const int max_contacts = 16;
Vector2 result[max_contacts * 2];
@@ -97,7 +91,6 @@ Array Shape2D::collide_and_get_contacts(const Transform2D &p_local_xform, const
}
void Shape2D::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("set_custom_solver_bias", "bias"), &Shape2D::set_custom_solver_bias);
ClassDB::bind_method(D_METHOD("get_custom_solver_bias"), &Shape2D::get_custom_solver_bias);
ClassDB::bind_method(D_METHOD("collide", "local_xform", "with_shape", "shape_xform"), &Shape2D::collide);
@@ -114,6 +107,5 @@ Shape2D::Shape2D(const RID &p_rid) {
}
Shape2D::~Shape2D() {
-
PhysicsServer2D::get_singleton()->free(shape);
}