Merge pull request #45154 from lawnjelly/bvh_fix_setting

Fix BVH physics project setting
This commit is contained in:
Rémi Verschelde 2021-01-13 12:44:02 +01:00 committed by GitHub
commit ef683e761d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -170,6 +170,10 @@ static String get_full_version_string() {
// FIXME: Could maybe be moved to PhysicsServerManager and Physics2DServerManager directly
// to have less code in main.cpp.
void initialize_physics() {
// This must be defined BEFORE the 3d physics server is created
GLOBAL_DEF("physics/3d/godot_physics/use_bvh", true);
/// 3D Physics Server
physics_server = PhysicsServerManager::new_server(ProjectSettings::get_singleton()->get(PhysicsServerManager::setting_property_name));
if (!physics_server) {

View File

@ -335,10 +335,6 @@ void World::_bind_methods() {
World::World() {
// These defaults must be created BEFORE creating the scenario, because the BVH reads
// the defaults at that point.
GLOBAL_DEF("physics/3d/godot_physics/use_bvh", true);
space = PhysicsServer::get_singleton()->space_create();
scenario = VisualServer::get_singleton()->scenario_create();