summaryrefslogtreecommitdiff
path: root/main/performance.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-09-02 23:13:40 -0300
committerDana Olson <dana@shineuponthee.com>2014-09-15 17:43:28 -0400
commit247e7ed716a4c0bd5140c2b2a938f7118e84fb14 (patch)
tree2487f84d19ea60c4140c085164219a893a4f8566 /main/performance.cpp
parentdbae857b293231882307c52217e9569a17da0f23 (diff)
3D Physics and Other Stuff
-=-=-=-=-=-=-=-=-=-=-=-=-= -New Vehicle (Based on Bullet's RaycastVehicle) - Vehiclebody/VehicleWheel. Demo will come soon, old vehicle (CarBody) will go away soon too. -A lot of fixes to the 3D physics engine -Added KinematicBody with demo -Fixed the space query API for 2D (demo will come soon). 3D is WIP. -Fixed long-standing bug with body_enter/body_exit for Area and Area2D -Performance variables now includes physics (active bodies, collision pairs and islands) -Ability to see what's inside of instanced scenes! -Fixed Blend Shapes (no bs+skeleton yet) -Added an Android JavaClassWrapper singleton for using Android native classes directly from GDScript. This is very Alpha!
Diffstat (limited to 'main/performance.cpp')
-rw-r--r--main/performance.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/main/performance.cpp b/main/performance.cpp
index 81db7ae1fa..9999cc0ae0 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -29,6 +29,8 @@
#include "performance.h"
#include "os/os.h"
#include "servers/visual_server.h"
+#include "servers/physics_2d_server.h"
+#include "servers/physics_server.h"
#include "message_queue.h"
#include "scene/main/scene_main_loop.h"
Performance *Performance::singleton=NULL;
@@ -61,6 +63,13 @@ void Performance::_bind_methods() {
BIND_CONSTANT( RENDER_VIDEO_MEM_USED );
BIND_CONSTANT( RENDER_TEXTURE_MEM_USED );
BIND_CONSTANT( RENDER_VERTEX_MEM_USED );
+ BIND_CONSTANT( PHYSICS_2D_ACTIVE_OBJECTS );
+ BIND_CONSTANT( PHYSICS_2D_COLLISION_PAIRS );
+ BIND_CONSTANT( PHYSICS_2D_ISLAND_COUNT );
+ BIND_CONSTANT( PHYSICS_3D_ACTIVE_OBJECTS );
+ BIND_CONSTANT( PHYSICS_3D_COLLISION_PAIRS );
+ BIND_CONSTANT( PHYSICS_3D_ISLAND_COUNT );
+
BIND_CONSTANT( MONITOR_MAX );
}
@@ -90,7 +99,14 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
"video/video_mem",
"video/texure_mem",
"video/vertex_mem",
- "render/mem_max"
+ "video/video_mem_max",
+ "physics_2d/active_objects",
+ "physics_2d/collision_pairs",
+ "physics_2d/islands",
+ "physics_3d/active_objects",
+ "physics_3d/collision_pairs",
+ "physics_3d/islands",
+
};
return names[p_monitor];
@@ -133,6 +149,13 @@ float Performance::get_monitor(Monitor p_monitor) const {
case RENDER_TEXTURE_MEM_USED: return VS::get_singleton()->get_render_info(VS::INFO_TEXTURE_MEM_USED);
case RENDER_VERTEX_MEM_USED: return VS::get_singleton()->get_render_info(VS::INFO_VERTEX_MEM_USED);
case RENDER_USAGE_VIDEO_MEM_TOTAL: return VS::get_singleton()->get_render_info(VS::INFO_USAGE_VIDEO_MEM_TOTAL);
+ case PHYSICS_2D_ACTIVE_OBJECTS: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_2D_COLLISION_PAIRS: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_COLLISION_PAIRS);
+ case PHYSICS_2D_ISLAND_COUNT: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_ISLAND_COUNT);
+ case PHYSICS_3D_ACTIVE_OBJECTS: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_3D_COLLISION_PAIRS: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_COLLISION_PAIRS);
+ case PHYSICS_3D_ISLAND_COUNT: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_ISLAND_COUNT);
+
default: {}
}