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/physics_server_sw.cpp | |
parent | 3f9e5afe68df1e3b4bcf34a21468ed55a57a7973 (diff) | |
parent | 889d21e0049a0e84d6d44db9b80193f93fd62f17 (diff) |
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/physics_server_sw.cpp')
-rw-r--r-- | servers/physics/physics_server_sw.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 521ffae0ea..a9a8042c19 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -201,6 +201,30 @@ PhysicsDirectSpaceState* PhysicsServerSW::space_get_direct_state(RID p_space) { return space->get_direct_state(); } +void PhysicsServerSW::space_set_debug_contacts(RID p_space,int p_max_contacts) { + + SpaceSW *space = space_owner.get(p_space); + ERR_FAIL_COND(!space); + space->set_debug_contacts(p_max_contacts); + +} + +Vector<Vector3> PhysicsServerSW::space_get_contacts(RID p_space) const { + + SpaceSW *space = space_owner.get(p_space); + ERR_FAIL_COND_V(!space,Vector<Vector3>()); + return space->get_debug_contacts(); + +} + +int PhysicsServerSW::space_get_contact_count(RID p_space) const { + + SpaceSW *space = space_owner.get(p_space); + ERR_FAIL_COND_V(!space,0); + return space->get_debug_contact_count(); + +} + RID PhysicsServerSW::area_create() { AreaSW *area = memnew( AreaSW ); |