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.
o3de/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorSystemComponent.cpp

64 lines
2.1 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
*
*/
#include <ActorSystemComponent.h>
#include <AtomBackend.h>
#include <Integration/Rendering/RenderBackendManager.h>
#include <AzCore/Serialization/SerializeContext.h>
namespace AZ
{
namespace Render
{
ActorSystemComponent::ActorSystemComponent() = default;
ActorSystemComponent::~ActorSystemComponent() = default;
void ActorSystemComponent::Reflect(ReflectContext* context)
{
if (SerializeContext* serialize = azrtti_cast<SerializeContext*>(context))
{
serialize->Class<ActorSystemComponent, Component>()
->Version(0)
;
}
}
void ActorSystemComponent::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided)
{
provided.push_back(AZ_CRC("ActorSystemService", 0x5e493d6c));
}
void ActorSystemComponent::GetIncompatibleServices(ComponentDescriptor::DependencyArrayType& incompatible)
{
incompatible.push_back(AZ_CRC("ActorSystemService", 0x5e493d6c));
}
void ActorSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
{
required.push_back(AZ_CRC("SkinnedMeshService", 0xac7cea96));
required.push_back(AZ_CRC("EMotionFXAnimationService", 0x3f8a6369));
}
void ActorSystemComponent::Activate()
{
AZ_Assert(AZ::Interface<EMotionFX::Integration::RenderBackendManager>::Get(), "The EMotionFX RenderBackendManger must be initialized before a render backend can register itself.");
// The RenderBackendManager will manage the lifetime of the AtomBackend
AZ::Interface<EMotionFX::Integration::RenderBackendManager>::Get()->SetRenderBackend(aznew AtomBackend());
}
void ActorSystemComponent::Deactivate()
{
}
} // End Render namespace
} // End AZ namespace