diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-09-20 13:03:46 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-09-20 13:03:46 -0300 |
commit | 83d9a692be648668b5b363f2424c619e15639843 (patch) | |
tree | 387b30810994b282c795fdd011f53f0b7eb93ace /servers/physics/space_sw.h | |
parent | 3f9e5afe68df1e3b4bcf34a21468ed55a57a7973 (diff) | |
parent | 889d21e0049a0e84d6d44db9b80193f93fd62f17 (diff) | |
download | redot-engine-83d9a692be648668b5b363f2424c619e15639843.tar.gz |
Ability to visually debug geometry visually:
-Visible 2D and 3D Shapes, Polygons, Tile collisions, etc.
-Visible Navmesh and Navpoly
-Visible collision contacts for 2D and 3D as a red point
-Customizable colors in project settings
Diffstat (limited to 'servers/physics/space_sw.h')
-rw-r--r-- | servers/physics/space_sw.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h index 16f5ad3c81..e88f61d881 100644 --- a/servers/physics/space_sw.h +++ b/servers/physics/space_sw.h @@ -103,6 +103,9 @@ class SpaceSW { RID static_global_body;
+ Vector<Vector3> contact_debug;
+ int contact_debug_count;
+
friend class PhysicsDirectSpaceStateSW;
public:
@@ -166,6 +169,11 @@ public: PhysicsDirectSpaceStateSW *get_direct_state();
+ void set_debug_contacts(int p_amount) { contact_debug.resize(p_amount); }
+ _FORCE_INLINE_ bool is_debugging_contacts() const { return !contact_debug.empty(); }
+ _FORCE_INLINE_ void add_debug_contact(const Vector3& p_contact) { if (contact_debug_count<contact_debug.size()) contact_debug[contact_debug_count++]=p_contact; }
+ _FORCE_INLINE_ Vector<Vector3> get_debug_contacts() { return contact_debug; }
+ _FORCE_INLINE_ int get_debug_contact_count() { return contact_debug_count; }
void set_static_global_body(RID p_body) { static_global_body=p_body; }
RID get_static_global_body() { return static_global_body; }
|