Add Physics::DeleteScene
This commit is contained in:
@@ -184,6 +184,15 @@ PhysicsScene* Physics::FindScene(const StringView& name)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Physics::DeleteScene(PhysicsScene* scene)
|
||||
{
|
||||
if (scene == nullptr || scene == DefaultScene)
|
||||
return;
|
||||
scene->CollectResults();
|
||||
Scenes.RemoveKeepOrder(scene);
|
||||
Delete(scene);
|
||||
}
|
||||
|
||||
bool Physics::GetAutoSimulation()
|
||||
{
|
||||
return !DefaultScene || DefaultScene->GetAutoSimulation();
|
||||
|
||||
@@ -32,6 +32,11 @@ API_CLASS(Static) class FLAXENGINE_API Physics
|
||||
/// </summary>
|
||||
API_FUNCTION() static PhysicsScene* FindScene(const StringView& name);
|
||||
|
||||
/// <summary>
|
||||
/// Delete an existing scene (excluding the default one).
|
||||
/// </summary>
|
||||
API_FUNCTION() static void DeleteScene(PhysicsScene* scene);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// The automatic simulation feature. True if perform physics simulation after on fixed update by auto, otherwise user should do it.
|
||||
|
||||
Reference in New Issue
Block a user