summaryrefslogtreecommitdiff
path: root/servers/physics
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-09-19 18:39:50 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-09-19 18:39:50 -0300
commit549d344f0fef5e5748ded69b6a037698ff55f8bc (patch)
treea22ee2a3b0d6303fe3e4348831e7f581dd8a0a07 /servers/physics
parent526aae62edfa31aa156d604e8b25caab512c6bff (diff)
Fixing Issues...
- #672 (default user:// in $HOME/.godot/app_userdata (linux/osx) and $APPDATA/Godot/app_userdata (Windows) - #676 (draw both tiles and octants in order from top to bottom, left to right ) - #686 (unicode escape sequences work now) - #702 (was not a bug, but a test was added to see if bodies went too far away)
Diffstat (limited to 'servers/physics')
-rw-r--r--servers/physics/collision_object_sw.h17
-rw-r--r--servers/physics/collision_solver_sw.cpp3
2 files changed, 19 insertions, 1 deletions
diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h
index 558a48f6fd..e717cc257c 100644
--- a/servers/physics/collision_object_sw.h
+++ b/servers/physics/collision_object_sw.h
@@ -34,6 +34,9 @@
#include "self_list.h"
#include "broad_phase_sw.h"
+#define MAX_OBJECT_DISTANCE 10000000
+#define MAX_OBJECT_DISTANCE_X2 (MAX_OBJECT_DISTANCE*MAX_OBJECT_DISTANCE)
+
class SpaceSW;
class CollisionObjectSW : public ShapeOwnerSW {
@@ -72,7 +75,19 @@ protected:
void _update_shapes_with_motion(const Vector3& p_motion);
void _unregister_shapes();
- _FORCE_INLINE_ void _set_transform(const Transform& p_transform,bool p_update_shapes=true) { transform=p_transform; if (p_update_shapes) _update_shapes(); }
+ _FORCE_INLINE_ void _set_transform(const Transform& p_transform,bool p_update_shapes=true) {
+
+#ifdef DEBUG_ENABLED
+
+ if (p_transform.origin.length_squared() > MAX_OBJECT_DISTANCE_X2) {
+ ERR_EXPLAIN("Object went too far away (more than "+itos(MAX_OBJECT_DISTANCE)+"mts from origin).");
+ ERR_FAIL();
+ }
+#endif
+
+ transform=p_transform; if (p_update_shapes) _update_shapes();
+
+ }
_FORCE_INLINE_ void _set_inv_transform(const Transform& p_transform) { inv_transform=p_transform; }
void _set_static(bool p_static);
diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp
index 673f2d4385..56f2784145 100644
--- a/servers/physics/collision_solver_sw.cpp
+++ b/servers/physics/collision_solver_sw.cpp
@@ -180,6 +180,7 @@ bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A,const Transform&
}
concave_B->cull(local_aabb,concave_callback,&cinfo);
+ //print_line("COL AABB TESTS: "+itos(cinfo.aabb_tests));
return cinfo.collided;
}
@@ -346,6 +347,8 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A,const Transform&
}
+ //print_line("DIST AABB TESTS: "+itos(cinfo.aabb_tests));
+
return !cinfo.collided;
} else {