diff options
| author | Juan Linietsky | 2014-09-19 18:39:50 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-09-19 18:39:50 -0300 |
| commit | 549d344f0fef5e5748ded69b6a037698ff55f8bc (patch) | |
| tree | a22ee2a3b0d6303fe3e4348831e7f581dd8a0a07 /servers/physics/collision_object_sw.h | |
| parent | 526aae62edfa31aa156d604e8b25caab512c6bff (diff) | |
| download | godot-549d344f0fef5e5748ded69b6a037698ff55f8bc.tar.gz godot-549d344f0fef5e5748ded69b6a037698ff55f8bc.tar.zst godot-549d344f0fef5e5748ded69b6a037698ff55f8bc.zip | |
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/collision_object_sw.h')
| -rw-r--r-- | servers/physics/collision_object_sw.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index 558a48f6f..e717cc257 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); |
