Revamped AzFramework::Scene (#332)
Updated AzFramework::Scene to allow it to serve as the one-stop location for localized singletons. Localized singletons in this case are instance that can only occur once in an environment but multiple times within an application. As an example, this allows settings up a single camera per viewport for instance. Highlights of changes: Replaced the original ebuses with interfaces and events for easy of use and performance. Removed the Entity Context specific code and moved that to new locations within the Entity Context itself. Allowed basic inheritance. If a subsystem isn't found in a scene the parent can optionally be searched. Scenes can enter a zombie state and avoid immediately being deleted. This is needed for situations where subsystems can't be destroyed until async calls have been completed.
This commit is contained in:
+1
-1
@@ -82,7 +82,7 @@ namespace AtomToolsFramework
|
||||
AZ::RPI::ConstViewportContextPtr GetViewportContext() const;
|
||||
//! Creates an AZ::RPI::ScenePtr for the given scene and assigns it to the current ViewportContext.
|
||||
//! If useDefaultRenderPipeline is specified, this will initialize the scene with a rendering pipeline.
|
||||
void SetScene(AzFramework::Scene* scene, bool useDefaultRenderPipeline = true);
|
||||
void SetScene(const AZStd::shared_ptr<AzFramework::Scene>& scene, bool useDefaultRenderPipeline = true);
|
||||
//! Gets the default camera that's been automatically registered to our ViewportContext.
|
||||
AZ::RPI::ViewPtr GetDefaultCamera();
|
||||
AZ::RPI::ConstViewPtr GetDefaultCamera() const;
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace AtomToolsFramework
|
||||
return m_viewportContext;
|
||||
}
|
||||
|
||||
void RenderViewportWidget::SetScene(AzFramework::Scene* scene, bool useDefaultRenderPipeline)
|
||||
void RenderViewportWidget::SetScene(const AZStd::shared_ptr<AzFramework::Scene>& scene, bool useDefaultRenderPipeline)
|
||||
{
|
||||
if (scene == nullptr)
|
||||
{
|
||||
@@ -128,7 +128,7 @@ namespace AtomToolsFramework
|
||||
AZ::RPI::ScenePtr atomScene;
|
||||
auto initializeScene = [&](AZ::Render::Bootstrap::Request* bootstrapRequests)
|
||||
{
|
||||
atomScene = bootstrapRequests->GetOrCreateAtomSceneFromAzScene(scene);
|
||||
atomScene = bootstrapRequests->GetOrCreateAtomSceneFromAzScene(scene.get());
|
||||
if (useDefaultRenderPipeline)
|
||||
{
|
||||
// atomScene may already have a default render pipeline installed.
|
||||
|
||||
Reference in New Issue
Block a user