/**************************************************************************/ /* physics_server_3d_manager.h */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #pragma once #include "core/object/object.h" class PhysicsServer3D; class PhysicsServer3DManager : public Object { GDCLASS(PhysicsServer3DManager, Object); static PhysicsServer3DManager *singleton; struct ClassInfo { String name; Callable create_callback; ClassInfo() {} ClassInfo(String p_name, Callable 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) {} void operator=(const ClassInfo &p_ci) { name = p_ci.name; create_callback = p_ci.create_callback; } }; Vector physics_servers; int default_server_id = -1; int default_server_priority = -1; void on_servers_changed(); protected: static void _bind_methods(); public: static const String setting_property_name; static PhysicsServer3DManager *get_singleton(); void register_server(const String &p_name, const Callable &p_create_callback); void set_default_server(const String &p_name, int p_priority = 0); int find_server_id(const String &p_name); int get_servers_count(); String get_server_name(int p_id); PhysicsServer3D *new_default_server(); PhysicsServer3D *new_server(const String &p_name); static void initialize_server(); static void finalize_server(); static void initialize_server_manager(); static void finalize_server_manager(); };