Files
o3de/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorInstance.cpp
T
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
2021-06-30 19:51:55 -07:00

78 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 <EMotionFX/Source/Actor.h>
#include <Integration/Rendering/RenderActorInstance.h>
#include <Integration/System/SystemCommon.h>
namespace EMotionFX
{
namespace Integration
{
AZ_CLASS_ALLOCATOR_IMPL(RenderActorInstance, EMotionFXAllocator, 0);
RenderActorInstance::RenderActorInstance(const AZ::Data::Asset<ActorAsset>& actorAsset,
ActorInstance* actorInstance, AZ::EntityId entityId)
: m_actorAsset(actorAsset)
, m_actorInstance(actorInstance)
, m_entityId(entityId)
{
}
SkinningMethod RenderActorInstance::GetSkinningMethod() const
{
return m_skinningMethod;
}
void RenderActorInstance::SetSkinningMethod(SkinningMethod skinningMethod)
{
m_skinningMethod = skinningMethod;
}
void RenderActorInstance::SetOnMaterialChangedCallback(MaterialChangedFunction callback)
{
m_onMaterialChangedCallback = callback;
}
const AZ::Aabb& RenderActorInstance::GetWorldAABB() const
{
return m_worldAABB;
}
const AZ::Aabb& RenderActorInstance::GetLocalAABB() const
{
return m_localAABB;
}
bool RenderActorInstance::IsVisible() const
{
return m_isVisible;
}
void RenderActorInstance::SetIsVisible(bool isVisible)
{
m_isVisible = isVisible;
}
bool RenderActorInstance::IsInCameraFrustum() const
{
return true;
}
Actor* RenderActorInstance::GetActor() const
{
ActorAsset* actorAsset = m_actorAsset.Get();
if (actorAsset)
{
return actorAsset->GetActor();
}
return nullptr;
}
} // namespace Integration
} // namespace EMotionFX