diff --git a/atom_gems/AtomTutorials/Code/CMakeLists.txt b/atom_gems/AtomTutorials/Code/CMakeLists.txt index 15ea291..2ff56e4 100644 --- a/atom_gems/AtomTutorials/Code/CMakeLists.txt +++ b/atom_gems/AtomTutorials/Code/CMakeLists.txt @@ -13,6 +13,7 @@ ly_add_target( BUILD_DEPENDENCIES INTERFACE AZ::AzCore + Gem::Atom_Feature_Common.Public ) # The AtomTutorials.Private.Object target is an internal target @@ -32,6 +33,13 @@ ly_add_target( PUBLIC AZ::AzCore AZ::AzFramework + AZ::AzToolsFramework + Gem::AtomTutorials.API + Gem::LmbrCentral.Static + Gem::GradientSignal.Static + Gem::SurfaceData.Static + Gem::Atom_Feature_Common.Static + Gem::Atom_Bootstrap.Headers ) # Here add AtomTutorials target, it depends on the Private Object library and Public API interface @@ -50,6 +58,9 @@ ly_add_target( Gem::AtomTutorials.API PRIVATE Gem::AtomTutorials.Private.Object + RUNTIME_DEPENDENCIES + Gem::Atom_RPI.Private + Gem::Atom_Feature_Common ) # By default, we will specify that the above target AtomTutorials would be used by @@ -64,19 +75,6 @@ ly_create_alias(NAME AtomTutorials.Servers.API NAMESPACE Gem TARGETS Gem::AtomTu # If we are on a host platform, we want to add the host tools targets like the AtomTutorials.Editor MODULE target if(PAL_TRAIT_BUILD_HOST_TOOLS) - # The AtomTutorials.Editor.API target can be used by other gems that want to interact with the AtomTutorials.Editor module - ly_add_target( - NAME AtomTutorials.Editor.API INTERFACE - NAMESPACE Gem - FILES_CMAKE - atomtutorials_editor_api_files.cmake - INCLUDE_DIRECTORIES - INTERFACE - Include - BUILD_DEPENDENCIES - INTERFACE - AZ::AzToolsFramework - ) # The AtomTutorials.Editor.Private.Object target is an internal target # which is only to be used by this gems CMakeLists.txt and any subdirectories @@ -94,10 +92,21 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Include Source + COMPILE_DEFINITIONS + PRIVATE + ATOMTUTORIALS_EDITOR BUILD_DEPENDENCIES PUBLIC AZ::AzToolsFramework - $ + Gem::AtomTutorials.Private.Object + Gem::Atom_RPI.Edit + Gem::AtomToolsFramework.Static + Gem::AtomToolsFramework.Editor + AZ::SceneCore + AZ::SceneData + Legacy::Editor.Headers + Legacy::EditorCommon + Legacy::CryCommon ) ly_add_target( @@ -105,28 +114,40 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) NAMESPACE Gem AUTOMOC FILES_CMAKE - atomtutorials_editor_shared_files.cmake + atomtutorials_shared_files.cmake INCLUDE_DIRECTORIES PRIVATE Source PUBLIC Include + COMPILE_DEFINITIONS + PRIVATE + ATOMTUTORIALS_EDITOR BUILD_DEPENDENCIES - PUBLIC - Gem::AtomTutorials.Editor.API PRIVATE Gem::AtomTutorials.Editor.Private.Object + RUNTIME_DEPENDENCIES + Gem::Atom_RPI.Editor + Gem::Atom_Feature_Common.Editor + Gem::AtomToolsFramework.Editor + Legacy::EditorCommon ) # By default, we will specify that the above target AtomTutorials would be used by # Tool and Builder type targets when this gem is enabled. If you don't want it # active in Tools or Builders by default, delete one of both of the following lines: - ly_create_alias(NAME AtomTutorials.Tools NAMESPACE Gem TARGETS Gem::AtomTutorials.Editor) - ly_create_alias(NAME AtomTutorials.Builders NAMESPACE Gem TARGETS Gem::AtomTutorials.Editor) - - # For the Tools and Builders variants of AtomTutorials Gem, an alias to the AtomTutorials.Editor API target will be made - ly_create_alias(NAME AtomTutorials.Tools.API NAMESPACE Gem TARGETS Gem::AtomTutorials.Editor.API) - ly_create_alias(NAME AtomTutorials.Builders.API NAMESPACE Gem TARGETS Gem::AtomTutorials.Editor.API) + ly_create_alias(NAME AtomTutorials.Tools NAMESPACE Gem + TARGETS + Gem::AtomTutorials.Editor + Gem::Atom_Feature_Common.Builders + Gem::Atom_RPI.Builders + Gem::GradientSignal.Builders + ) + ly_create_alias(NAME AtomTutorials.Builders NAMESPACE Gem + TARGETS + Gem::AtomTutorials.Editor + Gem::GradientSignal.Tools + ) endif() diff --git a/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentBus.h b/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentBus.h new file mode 100644 index 0000000..6e175f4 --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentBus.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ +{ + namespace Render + { + //! Billboard ComponentRequestBus declares an interface for configuring and interacting with the billboard component + class BillboardComponentRequests : public ComponentBus + { + public: + }; + + using BillboardComponentRequestBus = EBus; + + //! BillboardComponentNotificationBus notifications are triggered whenever the billboard changes + class BillboardComponentNotifications : public ComponentBus + { + public: + //! Notify any handlers that the billboard has been modified + virtual void OnBillboardTransformed(){}; + }; + + using BillboardComponentNotificationBus = EBus; + + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentConfig.h b/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentConfig.h new file mode 100644 index 0000000..3a9a1ae --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentConfig.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ +{ + namespace Render + { + //! Common settings for GridComponents and EditorGridComponent. + class BillboardComponentConfig final + : public ComponentConfig + { + public: + AZ_RTTI(BillboardComponentConfig, "{864A9EB9-0ABB-47B0-AA2A-4E96840C8FD9}", ComponentConfig); + AZ_CLASS_ALLOCATOR(BillboardComponentConfig, SystemAllocator, 0); + + static void Reflect(ReflectContext* context); + }; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentConstants.h b/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentConstants.h new file mode 100644 index 0000000..fc3f246 --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Include/AtomTutorials/Billboard/BillboardComponentConstants.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +namespace AZ +{ + namespace Render + { + static constexpr const char* const BillboardComponentTypeId = "{15305641-513D-40FF-9F73-1707869CC96E}"; + static constexpr const char* const EditorBillboardComponentTypeId = "{D4205908-B206-4488-9381-A148D81F52E7}"; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/AtomTutorialsModuleInterface.h b/atom_gems/AtomTutorials/Code/Source/AtomTutorialsModuleInterface.h deleted file mode 100644 index 51488db..0000000 --- a/atom_gems/AtomTutorials/Code/Source/AtomTutorialsModuleInterface.h +++ /dev/null @@ -1,36 +0,0 @@ - -#include -#include -#include - -namespace AtomTutorials -{ - class AtomTutorialsModuleInterface - : public AZ::Module - { - public: - AZ_RTTI(AtomTutorialsModuleInterface, "{553B66F8-E05B-450B-81D2-3D5139B60B8A}", AZ::Module); - AZ_CLASS_ALLOCATOR(AtomTutorialsModuleInterface, AZ::SystemAllocator, 0); - - AtomTutorialsModuleInterface() - { - // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. - // Add ALL components descriptors associated with this gem to m_descriptors. - // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext. - // This happens through the [MyComponent]::Reflect() function. - m_descriptors.insert(m_descriptors.end(), { - AtomTutorialsSystemComponent::CreateDescriptor(), - }); - } - - /** - * Add required SystemComponents to the SystemEntity. - */ - AZ::ComponentTypeList GetRequiredSystemComponents() const override - { - return AZ::ComponentTypeList{ - azrtti_typeid(), - }; - } - }; -}// namespace AtomTutorials diff --git a/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponent.cpp b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponent.cpp new file mode 100644 index 0000000..beab1ae --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponent.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AZ +{ + namespace Render + { + BillboardComponent::BillboardComponent(const BillboardComponentConfig& config) + : BaseClass(config) + { + } + + void BillboardComponent::Reflect(AZ::ReflectContext* context) + { + BaseClass::Reflect(context); + + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ; + } + + if (auto behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class()->RequestBus("BillboardComponentRequestBus"); + + behaviorContext->ConstantProperty("BillboardComponentTypeId", BehaviorConstant(Uuid(BillboardComponentTypeId))) + ->Attribute(AZ::Script::Attributes::Module, "render") + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common); + } + } + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponent.h b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponent.h new file mode 100644 index 0000000..8229419 --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponent.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace AZ +{ + namespace Render + { + class BillboardComponent final + : public AzFramework::Components::ComponentAdapter + { + public: + + using BaseClass = AzFramework::Components::ComponentAdapter; + AZ_COMPONENT(AZ::Render::BillboardComponent, BillboardComponentTypeId, BaseClass); + + BillboardComponent() = default; + BillboardComponent(const BillboardComponentConfig& config); + + static void Reflect(AZ::ReflectContext* context); + }; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentConfig.cpp b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentConfig.cpp new file mode 100644 index 0000000..56fd317 --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentConfig.cpp @@ -0,0 +1,26 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AZ +{ + namespace Render + { + void BillboardComponentConfig::Reflect(ReflectContext* context) + { + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ; + } + } + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentController.cpp b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentController.cpp new file mode 100644 index 0000000..c30d686 --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentController.cpp @@ -0,0 +1,134 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + void BillboardComponentController::Reflect(ReflectContext* context) + { + BillboardComponentConfig::Reflect(context); + + if (SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("Configuration", &BillboardComponentController::m_configuration) + ; + } + + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->EBus("BillboardComponentRequestBus") + ; + } + } + + void BillboardComponentController::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC_CE("BillboardService")); + } + + void BillboardComponentController::GetIncompatibleServices(ComponentDescriptor::DependencyArrayType& incompatible) + { + incompatible.push_back(AZ_CRC_CE("BillboardService")); + } + + BillboardComponentController::BillboardComponentController(const BillboardComponentConfig& config) + : m_configuration(config) + { + } + + void BillboardComponentController::Activate(const AZ::EntityComponentIdPair& entityComponentIdPair) + { + const AZ::EntityId entityId = entityComponentIdPair.GetEntityId(); + m_entityComponentIdPair = entityComponentIdPair; + + RPI::Scene* scene = RPI::Scene::GetSceneForEntityId(entityId); + if (scene) + { + AZ::RPI::SceneNotificationBus::Handler::BusConnect(scene->GetId()); + } + + BillboardComponentRequestBus::Handler::BusConnect(entityId); + + m_meshFeatureProcessor = RPI::Scene::GetFeatureProcessorForEntity(entityId); + AZ_Assert(m_meshFeatureProcessor, "MeshFeatureProcessor not available."); + + AZ::Data::Asset materialAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath("materials/presets/pbr/metal_gold.azmaterial", AZ::RPI::AssetUtils::TraceLevel::Error); + m_material = AZ::RPI::Material::FindOrCreate(materialAsset); + m_modelAsset = AZ::RPI::AssetUtils::GetAssetByProductPath("materialeditor/viewportmodels/plane_1x1.azmodel", AZ::RPI::AssetUtils::TraceLevel::Assert); + + auto meshDescriptor = AZ::Render::MeshHandleDescriptor{ m_modelAsset }; + m_meshHandle = m_meshFeatureProcessor->AcquireMesh(meshDescriptor, m_material); + + m_meshFeatureProcessor->SetTransform(m_meshHandle, AZ::Transform::CreateIdentity()); + } + + void BillboardComponentController::Deactivate() + { + BillboardComponentRequestBus::Handler::BusDisconnect(); + AZ::RPI::SceneNotificationBus::Handler::BusDisconnect(); + + if (m_meshFeatureProcessor && m_meshHandle.IsValid()) + { + m_meshFeatureProcessor->ReleaseMesh(m_meshHandle); + } + m_meshFeatureProcessor = nullptr; + m_modelAsset.Release(); + + m_entityComponentIdPair = AZ::EntityComponentIdPair(AZ::EntityId(), AZ::InvalidComponentId); + } + + void BillboardComponentController::SetConfiguration(const BillboardComponentConfig& config) + { + m_configuration = config; + } + + const BillboardComponentConfig& BillboardComponentController::GetConfiguration() const + { + return m_configuration; + } + + + void BillboardComponentController::OnBeginPrepareRender() + { + SetBillboardTransform(); + } + + void BillboardComponentController::SetBillboardTransform() + { + m_meshFeatureProcessor = RPI::Scene::GetFeatureProcessorForEntity(m_entityComponentIdPair.GetEntityId()); + if (!m_meshFeatureProcessor) { + return; + } + + EntityId cameraId; + Camera::CameraSystemRequestBus::BroadcastResult(cameraId, &Camera::CameraSystemRequests::GetActiveCamera); + AZ::Vector3 cameraWorldPosition; + AZ::TransformBus::EventResult(cameraWorldPosition, cameraId, &AZ::TransformBus::Events::GetWorldTranslation); + + AZ::Vector3 entityWorldPosition; + AZ::TransformBus::EventResult(entityWorldPosition, m_entityComponentIdPair.GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation); + + // From mesh POV, the forward axis is Z positive, even though O3DE's default is Y positive for forward axis + AZ::Transform transform = AZ::Transform::CreateLookAt(entityWorldPosition, cameraWorldPosition, AZ::Transform::Axis::ZPositive); + m_meshFeatureProcessor->SetTransform(m_meshHandle, transform); + + BillboardComponentNotificationBus::Event(m_entityComponentIdPair.GetEntityId(), &BillboardComponentNotificationBus::Events::OnBillboardTransformed); + } + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentController.h b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentController.h new file mode 100644 index 0000000..d18a32c --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponentController.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + //! Controls behavior and rendering of a wireframe Billboard + class BillboardComponentController final + : public BillboardComponentRequestBus::Handler + , public AZ::RPI::SceneNotificationBus::Handler + { + public: + friend class EditorBillboardComponent; + + AZ_CLASS_ALLOCATOR(BillboardComponentController, SystemAllocator, 0) + AZ_RTTI(AZ::Render::BillboardComponentController, "{A0288BD7-B660-47B6-88D7-57E7C4F92FEK}"); + + static void Reflect(ReflectContext* context); + static void GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided); + static void GetIncompatibleServices(ComponentDescriptor::DependencyArrayType& incompatible); + + BillboardComponentController() = default; + BillboardComponentController(const BillboardComponentConfig& config); + + void Activate(const AZ::EntityComponentIdPair& entityComponentIdPair); + void Deactivate(); + void SetConfiguration(const BillboardComponentConfig& config); + const BillboardComponentConfig& GetConfiguration() const; + + private: + AZ_DISABLE_COPY(BillboardComponentController); + + // AZ::RPI::SceneNotificationBus::Handler overrides ... + void OnBeginPrepareRender() override; + + void SetBillboardTransform(); + + BillboardComponentConfig m_configuration; + + AZ::Render::MeshFeatureProcessorInterface* m_meshFeatureProcessor; + + AZ::Data::Asset m_modelAsset; + AZ::Render::MeshFeatureProcessorInterface::MeshHandle m_meshHandle; + AZ::Data::Instance m_material; + + AZ::EntityComponentIdPair m_entityComponentIdPair; + }; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/Billboard/EditorBillboardComponent.cpp b/atom_gems/AtomTutorials/Code/Source/Billboard/EditorBillboardComponent.cpp new file mode 100644 index 0000000..1299fa1 --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Source/Billboard/EditorBillboardComponent.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + void EditorBillboardComponent::Reflect(AZ::ReflectContext* context) + { + BaseClass::Reflect(context); + + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1, ConvertToEditorRenderComponentAdapter<1>); + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class( + "Billboard", "Adds billboard to the scene") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "AtomTutorials") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/Component_Placeholder.svg") + ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/Component_Placeholder.svg") + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/") + ; + + editContext->Class( + "BillboardComponentController", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &BillboardComponentController::m_configuration, "Configuration", "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ; + + editContext->Class( + "BillboardComponentConfig", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ; + } + } + + if (auto behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class()->RequestBus("BillboardComponentRequestBus"); + + behaviorContext->ConstantProperty("EditorBillboardComponentTypeId", BehaviorConstant(Uuid(EditorBillboardComponentTypeId))) + ->Attribute(AZ::Script::Attributes::Module, "render") + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); + } + } + + EditorBillboardComponent::EditorBillboardComponent(const BillboardComponentConfig& config) + : BaseClass(config) + { + } + + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/Billboard/EditorBillboardComponent.h b/atom_gems/AtomTutorials/Code/Source/Billboard/EditorBillboardComponent.h new file mode 100644 index 0000000..b4cd028 --- /dev/null +++ b/atom_gems/AtomTutorials/Code/Source/Billboard/EditorBillboardComponent.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + //! In-editor grid component + class EditorBillboardComponent final + : public EditorRenderComponentAdapter + { + public: + using BaseClass = EditorRenderComponentAdapter; + AZ_EDITOR_COMPONENT(AZ::Render::EditorBillboardComponent, EditorBillboardComponentTypeId, BaseClass); + + static void Reflect(AZ::ReflectContext* context); + + EditorBillboardComponent() = default; + EditorBillboardComponent(const BillboardComponentConfig& config); + }; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Code/Source/Clients/AtomTutorialsModule.cpp b/atom_gems/AtomTutorials/Code/Source/Clients/AtomTutorialsModule.cpp index 1e2da51..cf8c040 100644 --- a/atom_gems/AtomTutorials/Code/Source/Clients/AtomTutorialsModule.cpp +++ b/atom_gems/AtomTutorials/Code/Source/Clients/AtomTutorialsModule.cpp @@ -1,15 +1,54 @@ -#include +#include +#include +#include + #include "AtomTutorialsSystemComponent.h" +#include + +#ifdef ATOMTUTORIALS_EDITOR +#include +#include +#endif + namespace AtomTutorials { class AtomTutorialsModule - : public AtomTutorialsModuleInterface + : public AZ::Module { public: - AZ_RTTI(AtomTutorialsModule, "{C96BD29A-15A9-4C5F-8076-4C4DB113A5FE}", AtomTutorialsModuleInterface); + AZ_RTTI(AtomTutorialsModule, "{123CAB07-FB14-4CF2-A7FD-C550136194EC}", AZ::Module); AZ_CLASS_ALLOCATOR(AtomTutorialsModule, AZ::SystemAllocator, 0); + + AtomTutorialsModule() + : AZ::Module() + { + // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. + // Add ALL components descriptors associated with this gem to m_descriptors. + // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext. + // This happens through the [MyComponent]::Reflect() function. + m_descriptors.insert(m_descriptors.end(), { + AtomTutorialsSystemComponent::CreateDescriptor(), + AZ::Render::BillboardComponent::CreateDescriptor(), + +#ifdef ATOMTUTORIALS_EDITOR + AtomTutorialsEditorSystemComponent::CreateDescriptor(), + AZ::Render::EditorBillboardComponent::CreateDescriptor(), +#endif + }); + } + + AZ::ComponentTypeList GetRequiredSystemComponents() const override + { + return AZ::ComponentTypeList { + azrtti_typeid(), +#ifdef ATOMTUTORIALS_EDITOR + azrtti_typeid(), +#endif + }; + } + }; }// namespace AtomTutorials diff --git a/atom_gems/AtomTutorials/Code/Source/Tools/AtomTutorialsEditorModule.cpp b/atom_gems/AtomTutorials/Code/Source/Tools/AtomTutorialsEditorModule.cpp deleted file mode 100644 index 2fffb14..0000000 --- a/atom_gems/AtomTutorials/Code/Source/Tools/AtomTutorialsEditorModule.cpp +++ /dev/null @@ -1,46 +0,0 @@ - -#include -#include "AtomTutorialsEditorSystemComponent.h" - -void InitAtomTutorialsResources() -{ - // We must register our Qt resources (.qrc file) since this is being loaded from a separate module (gem) - Q_INIT_RESOURCE(AtomTutorials); -} - -namespace AtomTutorials -{ - class AtomTutorialsEditorModule - : public AtomTutorialsModuleInterface - { - public: - AZ_RTTI(AtomTutorialsEditorModule, "{C96BD29A-15A9-4C5F-8076-4C4DB113A5FE}", AtomTutorialsModuleInterface); - AZ_CLASS_ALLOCATOR(AtomTutorialsEditorModule, AZ::SystemAllocator, 0); - - AtomTutorialsEditorModule() - { - InitAtomTutorialsResources(); - - // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. - // Add ALL components descriptors associated with this gem to m_descriptors. - // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext. - // This happens through the [MyComponent]::Reflect() function. - m_descriptors.insert(m_descriptors.end(), { - AtomTutorialsEditorSystemComponent::CreateDescriptor(), - }); - } - - /** - * Add required SystemComponents to the SystemEntity. - * Non-SystemComponents should not be added here - */ - AZ::ComponentTypeList GetRequiredSystemComponents() const override - { - return AZ::ComponentTypeList { - azrtti_typeid(), - }; - } - }; -}// namespace AtomTutorials - -AZ_DECLARE_MODULE_CLASS(Gem_AtomTutorials, AtomTutorials::AtomTutorialsEditorModule) diff --git a/atom_gems/AtomTutorials/Code/Source/Tools/AtomTutorialsEditorSystemComponent.cpp b/atom_gems/AtomTutorials/Code/Source/Tools/AtomTutorialsEditorSystemComponent.cpp index de71a23..52f9c2f 100644 --- a/atom_gems/AtomTutorials/Code/Source/Tools/AtomTutorialsEditorSystemComponent.cpp +++ b/atom_gems/AtomTutorials/Code/Source/Tools/AtomTutorialsEditorSystemComponent.cpp @@ -23,13 +23,11 @@ namespace AtomTutorials void AtomTutorialsEditorSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { - BaseSystemComponent::GetProvidedServices(provided); provided.push_back(AZ_CRC_CE("AtomTutorialsEditorService")); } void AtomTutorialsEditorSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { - BaseSystemComponent::GetIncompatibleServices(incompatible); incompatible.push_back(AZ_CRC_CE("AtomTutorialsEditorService")); } diff --git a/atom_gems/AtomTutorials/Code/atomtutorials_api_files.cmake b/atom_gems/AtomTutorials/Code/atomtutorials_api_files.cmake index f5526ee..ae39ab9 100644 --- a/atom_gems/AtomTutorials/Code/atomtutorials_api_files.cmake +++ b/atom_gems/AtomTutorials/Code/atomtutorials_api_files.cmake @@ -1,3 +1,6 @@ set(FILES + Include/AtomTutorials/Billboard/BillboardComponentBus.h + Include/AtomTutorials/Billboard/BillboardComponentConfig.h + Include/AtomTutorials/Billboard/BillboardComponentConstants.h ) diff --git a/atom_gems/AtomTutorials/Code/atomtutorials_editor_private_files.cmake b/atom_gems/AtomTutorials/Code/atomtutorials_editor_private_files.cmake index 6b5df74..e2ffb08 100644 --- a/atom_gems/AtomTutorials/Code/atomtutorials_editor_private_files.cmake +++ b/atom_gems/AtomTutorials/Code/atomtutorials_editor_private_files.cmake @@ -1,5 +1,7 @@ set(FILES + Source/Billboard/EditorBillboardComponent.cpp + Source/Billboard/EditorBillboardComponent.h Source/Tools/AtomTutorialsEditorSystemComponent.cpp Source/Tools/AtomTutorialsEditorSystemComponent.h Source/Tools/AtomTutorialsWidget.cpp diff --git a/atom_gems/AtomTutorials/Code/atomtutorials_editor_shared_files.cmake b/atom_gems/AtomTutorials/Code/atomtutorials_editor_shared_files.cmake index c140053..f5526ee 100644 --- a/atom_gems/AtomTutorials/Code/atomtutorials_editor_shared_files.cmake +++ b/atom_gems/AtomTutorials/Code/atomtutorials_editor_shared_files.cmake @@ -1,4 +1,3 @@ set(FILES - Source/Tools/AtomTutorialsEditorModule.cpp ) diff --git a/atom_gems/AtomTutorials/Code/atomtutorials_private_files.cmake b/atom_gems/AtomTutorials/Code/atomtutorials_private_files.cmake index d52d38f..4fd48af 100644 --- a/atom_gems/AtomTutorials/Code/atomtutorials_private_files.cmake +++ b/atom_gems/AtomTutorials/Code/atomtutorials_private_files.cmake @@ -1,6 +1,10 @@ set(FILES - Source/AtomTutorialsModuleInterface.h Source/Clients/AtomTutorialsSystemComponent.cpp Source/Clients/AtomTutorialsSystemComponent.h + Source/Billboard/BillboardComponent.cpp + Source/Billboard/BillboardComponent.h + Source/Billboard/BillboardComponentConfig.cpp + Source/Billboard/BillboardComponentController.cpp + Source/Billboard/BillboardComponentController.h ) diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentBus.h b/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentBus.h new file mode 100644 index 0000000..89af84c --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentBus.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ +{ + namespace Render + { + //! Billboard ComponentRequestBus declares an interface for configuring and interacting with the billboard component + class BillboardComponentRequests : public ComponentBus + { + public: + }; + + using BillboardComponentRequestBus = EBus; + + //! BillboardComponentNotificationBus notifications are triggered whenever the grid changes + class BillboardComponentNotifications : public ComponentBus + { + public: + //! Notify any handlers that the billboard has been modified + virtual void OnBillboardTransformed(){}; + }; + + using BillboardComponentNotificationBus = EBus; + + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentConfig.h b/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentConfig.h new file mode 100644 index 0000000..3a9a1ae --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentConfig.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ +{ + namespace Render + { + //! Common settings for GridComponents and EditorGridComponent. + class BillboardComponentConfig final + : public ComponentConfig + { + public: + AZ_RTTI(BillboardComponentConfig, "{864A9EB9-0ABB-47B0-AA2A-4E96840C8FD9}", ComponentConfig); + AZ_CLASS_ALLOCATOR(BillboardComponentConfig, SystemAllocator, 0); + + static void Reflect(ReflectContext* context); + }; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentConstants.h b/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentConstants.h new file mode 100644 index 0000000..fc3f246 --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Include/BillboardComponentConstants.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +namespace AZ +{ + namespace Render + { + static constexpr const char* const BillboardComponentTypeId = "{15305641-513D-40FF-9F73-1707869CC96E}"; + static constexpr const char* const EditorBillboardComponentTypeId = "{D4205908-B206-4488-9381-A148D81F52E7}"; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponent.cpp b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponent.cpp new file mode 100644 index 0000000..beab1ae --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponent.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AZ +{ + namespace Render + { + BillboardComponent::BillboardComponent(const BillboardComponentConfig& config) + : BaseClass(config) + { + } + + void BillboardComponent::Reflect(AZ::ReflectContext* context) + { + BaseClass::Reflect(context); + + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ; + } + + if (auto behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class()->RequestBus("BillboardComponentRequestBus"); + + behaviorContext->ConstantProperty("BillboardComponentTypeId", BehaviorConstant(Uuid(BillboardComponentTypeId))) + ->Attribute(AZ::Script::Attributes::Module, "render") + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common); + } + } + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponent.h b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponent.h new file mode 100644 index 0000000..8229419 --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponent.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace AZ +{ + namespace Render + { + class BillboardComponent final + : public AzFramework::Components::ComponentAdapter + { + public: + + using BaseClass = AzFramework::Components::ComponentAdapter; + AZ_COMPONENT(AZ::Render::BillboardComponent, BillboardComponentTypeId, BaseClass); + + BillboardComponent() = default; + BillboardComponent(const BillboardComponentConfig& config); + + static void Reflect(AZ::ReflectContext* context); + }; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentConfig.cpp b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentConfig.cpp new file mode 100644 index 0000000..56fd317 --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentConfig.cpp @@ -0,0 +1,26 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AZ +{ + namespace Render + { + void BillboardComponentConfig::Reflect(ReflectContext* context) + { + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ; + } + } + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentController.cpp b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentController.cpp new file mode 100644 index 0000000..1d2efb2 --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentController.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + void BillboardComponentController::Reflect(ReflectContext* context) + { + BillboardComponentConfig::Reflect(context); + + if (SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("Configuration", &BillboardComponentController::m_configuration) + ; + } + + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->EBus("BillboardComponentRequestBus") + ; + } + } + + void BillboardComponentController::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC_CE("BillboardService")); + } + + void BillboardComponentController::GetIncompatibleServices(ComponentDescriptor::DependencyArrayType& incompatible) + { + incompatible.push_back(AZ_CRC_CE("BillboardService")); + } + + BillboardComponentController::BillboardComponentController(const BillboardComponentConfig& config) + : m_configuration(config) + { + } + + void BillboardComponentController::Activate(const AZ::EntityComponentIdPair& entityComponentIdPair) + { + const AZ::EntityId entityId = entityComponentIdPair.GetEntityId(); + m_entityComponentIdPair = entityComponentIdPair; + + BillboardComponentRequestBus::Handler::BusConnect(entityId); + } + + void BillboardComponentController::Deactivate() + { + BillboardComponentRequestBus::Handler::BusDisconnect(); + + m_entityComponentIdPair = AZ::EntityComponentIdPair(AZ::EntityId(), AZ::InvalidComponentId); + } + + void BillboardComponentController::SetConfiguration(const BillboardComponentConfig& config) + { + m_configuration = config; + } + + const BillboardComponentConfig& BillboardComponentController::GetConfiguration() const + { + return m_configuration; + } + + + void BillboardComponentController::OnBeginPrepareRender() + { + + } + + void BillboardComponentController::SetBillboardTransform() + { + + } + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentController.h b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentController.h new file mode 100644 index 0000000..d18a32c --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Source/BillboardComponentController.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + //! Controls behavior and rendering of a wireframe Billboard + class BillboardComponentController final + : public BillboardComponentRequestBus::Handler + , public AZ::RPI::SceneNotificationBus::Handler + { + public: + friend class EditorBillboardComponent; + + AZ_CLASS_ALLOCATOR(BillboardComponentController, SystemAllocator, 0) + AZ_RTTI(AZ::Render::BillboardComponentController, "{A0288BD7-B660-47B6-88D7-57E7C4F92FEK}"); + + static void Reflect(ReflectContext* context); + static void GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided); + static void GetIncompatibleServices(ComponentDescriptor::DependencyArrayType& incompatible); + + BillboardComponentController() = default; + BillboardComponentController(const BillboardComponentConfig& config); + + void Activate(const AZ::EntityComponentIdPair& entityComponentIdPair); + void Deactivate(); + void SetConfiguration(const BillboardComponentConfig& config); + const BillboardComponentConfig& GetConfiguration() const; + + private: + AZ_DISABLE_COPY(BillboardComponentController); + + // AZ::RPI::SceneNotificationBus::Handler overrides ... + void OnBeginPrepareRender() override; + + void SetBillboardTransform(); + + BillboardComponentConfig m_configuration; + + AZ::Render::MeshFeatureProcessorInterface* m_meshFeatureProcessor; + + AZ::Data::Asset m_modelAsset; + AZ::Render::MeshFeatureProcessorInterface::MeshHandle m_meshHandle; + AZ::Data::Instance m_material; + + AZ::EntityComponentIdPair m_entityComponentIdPair; + }; + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Source/EditorBillboardComponent.cpp b/atom_gems/AtomTutorials/Templates/Billboard/Source/EditorBillboardComponent.cpp new file mode 100644 index 0000000..1299fa1 --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Source/EditorBillboardComponent.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + void EditorBillboardComponent::Reflect(AZ::ReflectContext* context) + { + BaseClass::Reflect(context); + + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1, ConvertToEditorRenderComponentAdapter<1>); + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class( + "Billboard", "Adds billboard to the scene") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "AtomTutorials") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/Component_Placeholder.svg") + ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/Component_Placeholder.svg") + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/") + ; + + editContext->Class( + "BillboardComponentController", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &BillboardComponentController::m_configuration, "Configuration", "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ; + + editContext->Class( + "BillboardComponentConfig", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ; + } + } + + if (auto behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class()->RequestBus("BillboardComponentRequestBus"); + + behaviorContext->ConstantProperty("EditorBillboardComponentTypeId", BehaviorConstant(Uuid(EditorBillboardComponentTypeId))) + ->Attribute(AZ::Script::Attributes::Module, "render") + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); + } + } + + EditorBillboardComponent::EditorBillboardComponent(const BillboardComponentConfig& config) + : BaseClass(config) + { + } + + } // namespace Render +} // namespace AZ diff --git a/atom_gems/AtomTutorials/Templates/Billboard/Source/EditorBillboardComponent.h b/atom_gems/AtomTutorials/Templates/Billboard/Source/EditorBillboardComponent.h new file mode 100644 index 0000000..b4cd028 --- /dev/null +++ b/atom_gems/AtomTutorials/Templates/Billboard/Source/EditorBillboardComponent.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + //! In-editor grid component + class EditorBillboardComponent final + : public EditorRenderComponentAdapter + { + public: + using BaseClass = EditorRenderComponentAdapter; + AZ_EDITOR_COMPONENT(AZ::Render::EditorBillboardComponent, EditorBillboardComponentTypeId, BaseClass); + + static void Reflect(AZ::ReflectContext* context); + + EditorBillboardComponent() = default; + EditorBillboardComponent(const BillboardComponentConfig& config); + }; + } // namespace Render +} // namespace AZ