summaryrefslogtreecommitdiff
path: root/servers/physics_2d/body_2d_sw.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics_2d/body_2d_sw.h')
-rw-r--r--servers/physics_2d/body_2d_sw.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h
index a36dc3bfe2..c1fc4e2bb5 100644
--- a/servers/physics_2d/body_2d_sw.h
+++ b/servers/physics_2d/body_2d_sw.h
@@ -38,7 +38,6 @@
class Constraint2DSW;
class Body2DSW : public CollisionObject2DSW {
-
PhysicsServer2D::BodyMode mode;
Vector2 biased_linear_velocity;
@@ -87,7 +86,6 @@ class Body2DSW : public CollisionObject2DSW {
Map<Constraint2DSW *, int> constraint_map;
struct AreaCMP {
-
Area2DSW *area;
int refCount;
_FORCE_INLINE_ bool operator==(const AreaCMP &p_cmp) const { return area->get_self() == p_cmp.area->get_self(); }
@@ -102,7 +100,6 @@ class Body2DSW : public CollisionObject2DSW {
Vector<AreaCMP> areas;
struct Contact {
-
Vector2 local_pos;
Vector2 local_normal;
real_t depth;
@@ -118,7 +115,6 @@ class Body2DSW : public CollisionObject2DSW {
int contact_count;
struct ForceIntegrationCallback {
-
ObjectID id;
StringName method;
Variant callback_udata;
@@ -206,7 +202,6 @@ public:
}
_FORCE_INLINE_ void apply_impulse(const Vector2 &p_offset, const Vector2 &p_impulse) {
-
linear_velocity += p_impulse * _inv_mass;
angular_velocity += _inv_inertia * p_offset.cross(p_impulse);
}
@@ -216,7 +211,6 @@ public:
}
_FORCE_INLINE_ void apply_bias_impulse(const Vector2 &p_pos, const Vector2 &p_j) {
-
biased_linear_velocity += p_j * _inv_mass;
biased_angular_velocity += _inv_inertia * p_pos.cross(p_j);
}
@@ -250,7 +244,6 @@ public:
}
_FORCE_INLINE_ void add_force(const Vector2 &p_offset, const Vector2 &p_force) {
-
applied_force += p_force;
applied_torque += p_offset.cross(p_force);
}
@@ -278,7 +271,6 @@ public:
void integrate_velocities(real_t p_step);
_FORCE_INLINE_ Vector2 get_motion() const {
-
if (mode > PhysicsServer2D::BODY_MODE_KINEMATIC) {
return new_transform.get_origin() - get_transform().get_origin();
} else if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC) {
@@ -299,7 +291,6 @@ public:
//add contact inline
void Body2DSW::add_contact(const Vector2 &p_local_pos, const Vector2 &p_local_normal, real_t p_depth, int p_local_shape, const Vector2 &p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID &p_collider, const Vector2 &p_collider_velocity_at_pos) {
-
int c_max = contacts.size();
if (c_max == 0)
@@ -312,11 +303,9 @@ void Body2DSW::add_contact(const Vector2 &p_local_pos, const Vector2 &p_local_no
if (contact_count < c_max) {
idx = contact_count++;
} else {
-
real_t least_depth = 1e20;
int least_deep = -1;
for (int i = 0; i < c_max; i++) {
-
if (i == 0 || c[i].depth < least_depth) {
least_deep = i;
least_depth = c[i].depth;
@@ -324,7 +313,6 @@ void Body2DSW::add_contact(const Vector2 &p_local_pos, const Vector2 &p_local_no
}
if (least_deep >= 0 && least_depth < p_depth) {
-
idx = least_deep;
}
if (idx == -1)
@@ -343,7 +331,6 @@ void Body2DSW::add_contact(const Vector2 &p_local_pos, const Vector2 &p_local_no
}
class PhysicsDirectBodyState2DSW : public PhysicsDirectBodyState2D {
-
GDCLASS(PhysicsDirectBodyState2DSW, PhysicsDirectBodyState2D);
public: