Implemented physics plug
Moved init_physics Implemented physics 2D plug Fix clang Fix clang Fix static check Fix clang Fix static check Moved physics server initialization Moved physics server settings initialization
This commit is contained in:
@ -590,6 +590,43 @@ public:
|
||||
Physics2DTestMotionResult();
|
||||
};
|
||||
|
||||
typedef Physics2DServer *(*CreatePhysics2DServerCallback)();
|
||||
|
||||
class Physics2DServerManager {
|
||||
struct ClassInfo {
|
||||
String name;
|
||||
CreatePhysics2DServerCallback create_callback;
|
||||
|
||||
ClassInfo()
|
||||
: name(""), create_callback(NULL) {}
|
||||
|
||||
ClassInfo(String p_name, CreatePhysics2DServerCallback 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_2d_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, CreatePhysics2DServerCallback 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 Physics2DServer *new_default_server();
|
||||
static Physics2DServer *new_server(const String &p_name);
|
||||
};
|
||||
|
||||
VARIANT_ENUM_CAST(Physics2DServer::ShapeType);
|
||||
VARIANT_ENUM_CAST(Physics2DServer::SpaceParameter);
|
||||
VARIANT_ENUM_CAST(Physics2DServer::AreaParameter);
|
||||
|
||||
Reference in New Issue
Block a user