SceneSystem.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. #include <AzCore/std/smart_ptr/unique_ptr.h>
  10. #include <SceneAPI/SceneCore/DataTypes/MatrixType.h>
  11. namespace AZ
  12. {
  13. class Vector3;
  14. namespace SDKScene
  15. {
  16. class SceneWrapperBase;
  17. }
  18. namespace SceneAPI
  19. {
  20. class SceneSystem
  21. {
  22. public:
  23. SceneSystem();
  24. void Set(const SDKScene::SceneWrapperBase* sceneWrapper);
  25. void SwapVec3ForUpAxis(Vector3& swapVector) const;
  26. void SwapTransformForUpAxis(DataTypes::MatrixType& inOutTransform) const;
  27. void ConvertUnit(Vector3& scaleVector) const;
  28. void ConvertUnit(DataTypes::MatrixType& inOutTransform) const;
  29. void ConvertBoneUnit(DataTypes::MatrixType& inOutTransform) const;
  30. //! Get effect unit size in meters of this scene, internally FBX saves it in the following manner
  31. //! GlobalSettings: {
  32. //! P : "UnitScaleFactor", "double", "Number", "", 2.54
  33. float GetUnitSizeInMeters() const { return m_unitSizeInMeters; }
  34. //! Get original unit size in meters of this scene, internally FBX saves it in the following manner
  35. //! GlobalSettings: {
  36. //! P : "OriginalUnitScaleFactor", "double", "Number", "", 2.54
  37. float GetOriginalUnitSizeInMeters() const { return m_originalUnitSizeInMeters; }
  38. protected:
  39. float m_unitSizeInMeters = 1;
  40. float m_originalUnitSizeInMeters = 1;
  41. AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
  42. AZStd::unique_ptr<DataTypes::MatrixType> m_adjustTransform;
  43. AZStd::unique_ptr<DataTypes::MatrixType> m_adjustTransformInverse;
  44. AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
  45. };
  46. }
  47. };