summaryrefslogtreecommitdiff
path: root/servers/physics_server.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics_server.h')
-rw-r--r--servers/physics_server.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/servers/physics_server.h b/servers/physics_server.h
index 8cec125646..09990cd02a 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server.h
@@ -658,6 +658,43 @@ public:
~PhysicsServer();
};
+typedef PhysicsServer *(*CreatePhysicsServerCallback)();
+
+class PhysicsServerManager {
+ struct ClassInfo {
+ String name;
+ CreatePhysicsServerCallback create_callback;
+
+ ClassInfo()
+ : name(""), create_callback(NULL) {}
+
+ ClassInfo(String p_name, CreatePhysicsServerCallback p_create_callback)
+ : name(p_name), create_callback(p_create_callback) {}
+
+ ClassInfo(const ClassInfo &p_ci)
+ : name(p_ci.name), create_callback(p_ci.create_callback) {}
+ };
+
+ static Vector<ClassInfo> physics_servers;
+ static int default_server_id;
+ static int default_server_priority;
+
+public:
+ static const String setting_property_name;
+
+private:
+ static void on_servers_changed();
+
+public:
+ static void register_server(const String &p_name, CreatePhysicsServerCallback p_creat_callback);
+ static void set_default_server(const String &p_name, int p_priority = 0);
+ static int find_server_id(const String &p_name);
+ static int get_servers_count();
+ static String get_server_name(int p_id);
+ static PhysicsServer *new_default_server();
+ static PhysicsServer *new_server(const String &p_name);
+};
+
VARIANT_ENUM_CAST(PhysicsServer::ShapeType);
VARIANT_ENUM_CAST(PhysicsServer::SpaceParameter);
VARIANT_ENUM_CAST(PhysicsServer::AreaParameter);