summaryrefslogtreecommitdiffstats
path: root/servers/physics/space_sw.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-05-21 21:18:16 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-05-21 21:18:16 -0300
commita75f8963380a1f6ae8501f21a1d3f3bef8a89d91 (patch)
treeae561ded247f81565c8287b6fd4b816f6ec762e6 /servers/physics/space_sw.h
parentc195c0df6b36debc870216dd42e49fbda70fa861 (diff)
downloadredot-engine-a75f8963380a1f6ae8501f21a1d3f3bef8a89d91.tar.gz
First version of Profiler
It is now possible to profile GDScript as well as some parts of Godot internals.
Diffstat (limited to 'servers/physics/space_sw.h')
-rw-r--r--servers/physics/space_sw.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h
index 6300c206d8..3fdef7e62b 100644
--- a/servers/physics/space_sw.h
+++ b/servers/physics/space_sw.h
@@ -59,6 +59,20 @@ public:
class SpaceSW {
+public:
+
+ enum ElapsedTime {
+ ELAPSED_TIME_INTEGRATE_FORCES,
+ ELAPSED_TIME_GENERATE_ISLANDS,
+ ELAPSED_TIME_SETUP_CONSTRAINTS,
+ ELAPSED_TIME_SOLVE_CONSTRAINTS,
+ ELAPSED_TIME_INTEGRATE_VELOCITIES,
+ ELAPSED_TIME_MAX
+
+ };
+private:
+
+ uint64_t elapsed_time[ELAPSED_TIME_MAX];
PhysicsDirectSpaceStateSW *direct_access;
RID self;
@@ -178,6 +192,8 @@ public:
void set_static_global_body(RID p_body) { static_global_body=p_body; }
RID get_static_global_body() { return static_global_body; }
+ void set_elapsed_time(ElapsedTime p_time,uint64_t p_msec) { elapsed_time[p_time]=p_msec; }
+ uint64_t get_elapsed_time(ElapsedTime p_time) const { return elapsed_time[p_time]; }
SpaceSW();
~SpaceSW();