diff --git a/Source/Engine/Level/Level.cpp b/Source/Engine/Level/Level.cpp index 2073222fa..454939103 100644 --- a/Source/Engine/Level/Level.cpp +++ b/Source/Engine/Level/Level.cpp @@ -22,7 +22,6 @@ #include "Engine/Profiler/ProfilerCPU.h" #include "Engine/Scripting/Script.h" #include "Engine/Engine/Time.h" -#include "Engine/Physics/Physics.h" #include "Engine/Scripting/ManagedCLR/MAssembly.h" #include "Engine/Scripting/ManagedCLR/MClass.h" #include "Engine/Scripting/ManagedCLR/MDomain.h" @@ -779,8 +778,6 @@ bool LevelImpl::unloadScene(Scene* scene) // Force flush deleted objects so we actually delete unloaded scene objects (prevent from reloading their managed objects, etc.) ObjectsRemovalService::Flush(); - Physics::EndPlay(); - return false; } @@ -1031,8 +1028,6 @@ bool Level::loadScene(rapidjson_flax::Value& data, int32 engineBuild, Scene** ou { PROFILE_CPU_NAMED("BeginPlay"); - Physics::BeginPlay(); - ScopeLock lock(ScenesLock); Scenes.Add(scene); SceneBeginData beginData; diff --git a/Source/Engine/Physics/Physics.cpp b/Source/Engine/Physics/Physics.cpp index e51d0c6d8..6198accfc 100644 --- a/Source/Engine/Physics/Physics.cpp +++ b/Source/Engine/Physics/Physics.cpp @@ -324,7 +324,6 @@ bool PhysicsService::Init() #endif Physics::DefaultScene = Physics::FindOrCreateScene(TEXT("Default")); - Physics::Scenes.Add(Physics::DefaultScene); // Create default resources DefaultMaterial = CPhysX->createMaterial(0.7f, 0.7f, 0.3f); @@ -533,14 +532,3 @@ PhysicsScene* Physics::FindScene(const String& name) return nullptr; } - -void Physics::BeginPlay() -{ - reset(); -} - - -void Physics::EndPlay() -{ - reset(); -} diff --git a/Source/Engine/Physics/Physics.h b/Source/Engine/Physics/Physics.h index 903737c08..f2317288a 100644 --- a/Source/Engine/Physics/Physics.h +++ b/Source/Engine/Physics/Physics.h @@ -2,7 +2,6 @@ #pragma once -#include "Engine/Core/Collections/Array.h" #include "Engine/Core/Math/Vector2.h" #include "Engine/Core/Math/Vector3.h" #include "Engine/Core/Math/Quaternion.h" @@ -111,7 +110,7 @@ public: /// List with all physics scenes (readonly). /// API_FIELD(ReadOnly) - static Array Scenes; + static Array Scenes; /// /// Finds an existing or creates it if it does not exist. @@ -590,8 +589,4 @@ public: /// /// The joint. static void RemoveJoint(Joint* joint); - -public: - static void BeginPlay(); - static void EndPlay(); };