summaryrefslogtreecommitdiff
path: root/servers/physics_2d
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-02-16 13:56:32 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-02-16 14:06:29 +0100
commitb8b45804485f7ca18f035f1eeb7a1ac0cf591cac (patch)
treec0fb75bd8d45125f436ccf0b64fcbae464b11ad9 /servers/physics_2d
parentf5b9cbaff6f0a058d08187b3124948ae68848cd0 (diff)
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
Diffstat (limited to 'servers/physics_2d')
-rw-r--r--servers/physics_2d/godot_body_pair_2d.cpp5
-rw-r--r--servers/physics_2d/godot_collision_solver_2d_sat.cpp4
-rw-r--r--servers/physics_2d/godot_physics_server_2d.cpp13
-rw-r--r--servers/physics_2d/godot_shape_2d.cpp6
4 files changed, 3 insertions, 25 deletions
diff --git a/servers/physics_2d/godot_body_pair_2d.cpp b/servers/physics_2d/godot_body_pair_2d.cpp
index 1986191cc3..2bf1e5a1d4 100644
--- a/servers/physics_2d/godot_body_pair_2d.cpp
+++ b/servers/physics_2d/godot_body_pair_2d.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "godot_body_pair_2d.h"
+
#include "godot_collision_solver_2d.h"
#include "godot_space_2d.h"
@@ -303,7 +304,7 @@ bool GodotBodyPair2D::setup(real_t p_step) {
bool valid = false;
for (int i = 0; i < contact_count; i++) {
Contact &c = contacts[i];
- if (c.normal.dot(direction) > -CMP_EPSILON) { //greater (normal inverted)
+ if (c.normal.dot(direction) > -CMP_EPSILON) { // Greater (normal inverted).
continue;
}
valid = true;
@@ -321,7 +322,7 @@ bool GodotBodyPair2D::setup(real_t p_step) {
bool valid = false;
for (int i = 0; i < contact_count; i++) {
Contact &c = contacts[i];
- if (c.normal.dot(direction) < CMP_EPSILON) { //less (normal ok)
+ if (c.normal.dot(direction) < CMP_EPSILON) { // Less (normal ok).
continue;
}
valid = true;
diff --git a/servers/physics_2d/godot_collision_solver_2d_sat.cpp b/servers/physics_2d/godot_collision_solver_2d_sat.cpp
index a965795bee..ded3ff356b 100644
--- a/servers/physics_2d/godot_collision_solver_2d_sat.cpp
+++ b/servers/physics_2d/godot_collision_solver_2d_sat.cpp
@@ -41,10 +41,6 @@ struct _CollectorCallback2D {
Vector2 *sep_axis = nullptr;
_FORCE_INLINE_ void call(const Vector2 &p_point_A, const Vector2 &p_point_B) {
- /*
- if (normal.dot(p_point_A) >= normal.dot(p_point_B))
- return;
- */
if (swap) {
callback(p_point_B, p_point_A, userdata);
} else {
diff --git a/servers/physics_2d/godot_physics_server_2d.cpp b/servers/physics_2d/godot_physics_server_2d.cpp
index 5e099e27ec..a9b499c6b5 100644
--- a/servers/physics_2d/godot_physics_server_2d.cpp
+++ b/servers/physics_2d/godot_physics_server_2d.cpp
@@ -1188,14 +1188,6 @@ void GodotPhysicsServer2D::free(RID p_rid) {
} else if (body_owner.owns(p_rid)) {
GodotBody2D *body = body_owner.get_or_null(p_rid);
- /*
- if (body->get_state_query())
- _clear_query(body->get_state_query());
-
- if (body->get_direct_state_query())
- _clear_query(body->get_direct_state_query());
- */
-
body_set_space(p_rid, RID());
while (body->get_shape_count()) {
@@ -1208,11 +1200,6 @@ void GodotPhysicsServer2D::free(RID p_rid) {
} else if (area_owner.owns(p_rid)) {
GodotArea2D *area = area_owner.get_or_null(p_rid);
- /*
- if (area->get_monitor_query())
- _clear_query(area->get_monitor_query());
- */
-
area->set_space(nullptr);
while (area->get_shape_count()) {
diff --git a/servers/physics_2d/godot_shape_2d.cpp b/servers/physics_2d/godot_shape_2d.cpp
index 1e8799a727..b5dbb8a2dd 100644
--- a/servers/physics_2d/godot_shape_2d.cpp
+++ b/servers/physics_2d/godot_shape_2d.cpp
@@ -544,12 +544,6 @@ bool GodotConvexPolygonShape2D::intersect_segment(const Vector2 &p_begin, const
bool inters = false;
for (int i = 0; i < point_count; i++) {
- //hmm.. no can do..
- /*
- if (d.dot(points[i].normal)>=0)
- continue;
- */
-
Vector2 res;
if (!Geometry2D::segment_intersects_segment(p_begin, p_end, points[i].pos, points[(i + 1) % point_count].pos, &res)) {