ActorAsset.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #pragma once
  9. #include <Integration/Rendering/RenderActorInstance.h>
  10. #include <AtomCore/Instance/Instance.h>
  11. #include <AzCore/Component/EntityId.h>
  12. #include <AzCore/Asset/AssetCommon.h>
  13. #include <AzCore/std/containers/vector.h>
  14. namespace EMotionFX
  15. {
  16. class Actor;
  17. class ActorInstance;
  18. }
  19. namespace AZ
  20. {
  21. namespace RPI
  22. {
  23. class Model;
  24. class Buffer;
  25. }
  26. namespace Render
  27. {
  28. class SkinnedMeshInputBuffers;
  29. //! Create a buffers and buffer views that are shared between all actor instances that use the same actor asset.
  30. AZStd::intrusive_ptr<SkinnedMeshInputBuffers> CreateSkinnedMeshInputFromActor(const Data::AssetId& actorAssetId, const EMotionFX::Actor* actor);
  31. //! Get the bone transforms from the actor instance and adjust them to be in the format needed by the renderer
  32. void GetBoneTransformsFromActorInstance(const EMotionFX::ActorInstance* actorInstance, AZStd::vector<float>& boneTransforms, EMotionFX::Integration::SkinningMethod skinningMethod);
  33. //! Create a buffer for bone transforms that can be used as input to the skinning shader
  34. Data::Instance<RPI::Buffer> CreateBoneTransformBufferFromActorInstance(const EMotionFX::ActorInstance* actorInstance, EMotionFX::Integration::SkinningMethod skinningMethod);
  35. } // namespace Render
  36. } // namespace AZ