Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 44 additions & 23 deletions atom_gems/AtomTutorials/Code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -94,39 +92,62 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
PRIVATE
Include
Source
COMPILE_DEFINITIONS
PRIVATE
ATOMTUTORIALS_EDITOR
BUILD_DEPENDENCIES
PUBLIC
AZ::AzToolsFramework
$<TARGET_OBJECTS:Gem::AtomTutorials.Private.Object>
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(
NAME AtomTutorials.Editor GEM_MODULE
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()

Expand Down
Original file line number Diff line number Diff line change
@@ -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 <AzCore/Component/ComponentBus.h>
#include <AzCore/Math/Color.h>

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<BillboardComponentRequests>;

//! 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<BillboardComponentNotifications>;

} // namespace Render
} // namespace AZ
Original file line number Diff line number Diff line change
@@ -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 <AzCore/Component/Component.h>
#include <AzCore/Math/Color.h>

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
Original file line number Diff line number Diff line change
@@ -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
36 changes: 0 additions & 36 deletions atom_gems/AtomTutorials/Code/Source/AtomTutorialsModuleInterface.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 <Billboard/BillboardComponent.h>
#include <AzCore/RTTI/BehaviorContext.h>

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<AZ::SerializeContext*>(context))
{
serializeContext->Class<BillboardComponent, BaseClass>()
->Version(0)
;
}

if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
{
behaviorContext->Class<BillboardComponent>()->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
33 changes: 33 additions & 0 deletions atom_gems/AtomTutorials/Code/Source/Billboard/BillboardComponent.h
Original file line number Diff line number Diff line change
@@ -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 <Billboard/BillboardComponentController.h>
#include <AtomTutorials/Billboard/BillboardComponentConstants.h>
#include <AzFramework/Components/ComponentAdapter.h>

namespace AZ
{
namespace Render
{
class BillboardComponent final
: public AzFramework::Components::ComponentAdapter<BillboardComponentController, BillboardComponentConfig>
{
public:

using BaseClass = AzFramework::Components::ComponentAdapter<BillboardComponentController, BillboardComponentConfig>;
AZ_COMPONENT(AZ::Render::BillboardComponent, BillboardComponentTypeId, BaseClass);

BillboardComponent() = default;
BillboardComponent(const BillboardComponentConfig& config);

static void Reflect(AZ::ReflectContext* context);
};
} // namespace Render
} // namespace AZ
Original file line number Diff line number Diff line change
@@ -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 <AtomTutorials/Billboard/BillboardComponentConfig.h>
#include <AzCore/Serialization/SerializeContext.h>

namespace AZ
{
namespace Render
{
void BillboardComponentConfig::Reflect(ReflectContext* context)
{
if (AZ::SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context))
{
serializeContext->Class<BillboardComponentConfig, ComponentConfig>()
->Version(0)
;
}
}
} // namespace Render
} // namespace AZ
Loading