3
0

RenderActorInstance.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <EMotionFX/Source/Actor.h>
  9. #include <Integration/Rendering/RenderActorInstance.h>
  10. #include <Integration/System/SystemCommon.h>
  11. namespace EMotionFX
  12. {
  13. namespace Integration
  14. {
  15. AZ_CLASS_ALLOCATOR_IMPL(RenderActorInstance, EMotionFXAllocator);
  16. RenderActorInstance::RenderActorInstance(const AZ::Data::Asset<ActorAsset>& actorAsset,
  17. ActorInstance* actorInstance, AZ::EntityId entityId)
  18. : m_actorAsset(actorAsset)
  19. , m_actorInstance(actorInstance)
  20. , m_entityId(entityId)
  21. {
  22. }
  23. SkinningMethod RenderActorInstance::GetSkinningMethod() const
  24. {
  25. return m_skinningMethod;
  26. }
  27. void RenderActorInstance::SetSkinningMethod(SkinningMethod skinningMethod)
  28. {
  29. m_skinningMethod = skinningMethod;
  30. }
  31. const AZ::Aabb& RenderActorInstance::GetWorldAABB() const
  32. {
  33. return m_worldAABB;
  34. }
  35. const AZ::Aabb& RenderActorInstance::GetLocalAABB() const
  36. {
  37. return m_localAABB;
  38. }
  39. bool RenderActorInstance::IsVisible() const
  40. {
  41. return m_isVisible;
  42. }
  43. void RenderActorInstance::SetIsVisible(bool isVisible)
  44. {
  45. m_isVisible = isVisible;
  46. }
  47. bool RenderActorInstance::IsInCameraFrustum() const
  48. {
  49. return true;
  50. }
  51. Actor* RenderActorInstance::GetActor() const
  52. {
  53. ActorAsset* actorAsset = m_actorAsset.Get();
  54. if (actorAsset)
  55. {
  56. return actorAsset->GetActor();
  57. }
  58. return nullptr;
  59. }
  60. } // namespace Integration
  61. } // namespace EMotionFX