You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.4 KiB
C++
68 lines
2.4 KiB
C++
/*
|
|
* 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 "Rendering/EntityDebugDisplayComponent.h"
|
|
#include "DiskShape.h"
|
|
|
|
namespace LmbrCentral
|
|
{
|
|
//! Provide a Component interface for DiskShape functionality.
|
|
class DiskShapeComponent
|
|
: public AZ::Component
|
|
{
|
|
public:
|
|
AZ_COMPONENT(DiskShapeComponent, DiskShapeComponentTypeId);
|
|
static void Reflect(AZ::ReflectContext* context);
|
|
|
|
// AZ::Component
|
|
void Activate() override;
|
|
void Deactivate() override;
|
|
bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override;
|
|
bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override;
|
|
|
|
private:
|
|
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
|
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
|
|
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
|
|
|
|
DiskShape m_diskShape; ///< Stores underlying disk type for this component.
|
|
};
|
|
|
|
//! Concrete EntityDebugDisplay implementation for DiskShape.
|
|
class DiskShapeDebugDisplayComponent
|
|
: public EntityDebugDisplayComponent
|
|
, public ShapeComponentNotificationsBus::Handler
|
|
{
|
|
public:
|
|
AZ_COMPONENT(DiskShapeDebugDisplayComponent, "{05CAEA04-C439-45F4-BBE7-3EDA8753D83B}", EntityDebugDisplayComponent)
|
|
static void Reflect(AZ::ReflectContext* context);
|
|
|
|
DiskShapeDebugDisplayComponent() = default;
|
|
|
|
// AZ::Component
|
|
void Activate() override;
|
|
void Deactivate() override;
|
|
bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override;
|
|
bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override;
|
|
|
|
// EntityDebugDisplayComponent
|
|
void Draw(AzFramework::DebugDisplayRequests& debugDisplay) override;
|
|
|
|
private:
|
|
AZ_DISABLE_COPY_MOVE(DiskShapeDebugDisplayComponent)
|
|
|
|
// ShapeComponentNotificationsBus
|
|
void OnShapeChanged(ShapeChangeReasons changeReason) override;
|
|
|
|
DiskShapeConfig m_diskShapeConfig; ///< Stores configuration data for disk shape.
|
|
};
|
|
} // namespace LmbrCentral
|