HairComponentConfig.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 <AzCore/Component/Component.h>
  10. #include <TressFX/TressFXSettings.h>
  11. #include <Assets/HairAsset.h>
  12. #include <Rendering/HairGlobalSettings.h>
  13. namespace AZ
  14. {
  15. namespace Render
  16. {
  17. namespace Hair
  18. {
  19. class EditorHairComponent;
  20. //! Reflects the TressFX settings and configuration data of the current hair object.
  21. class HairComponentConfig final :
  22. public ComponentConfig
  23. {
  24. friend class EditorHairComponent;
  25. public:
  26. AZ_CLASS_ALLOCATOR(HairComponentConfig, SystemAllocator)
  27. AZ_RTTI(HairComponentConfig, "{AF2C2F26-0C01-4EAD-A81C-4304BD751EDF}", AZ::ComponentConfig);
  28. static void Reflect(ReflectContext* context);
  29. void OnHairGlobalSettingsChanged();
  30. void SetEnabled(bool value)
  31. {
  32. m_enabled = value;
  33. }
  34. bool GetIsEnabled()
  35. {
  36. return m_enabled;
  37. }
  38. // TressFX settings
  39. AMD::TressFXSimulationSettings m_simulationSettings;
  40. AMD::TressFXRenderingSettings m_renderingSettings;
  41. Data::Asset<HairAsset> m_hairAsset;
  42. HairGlobalSettings m_hairGlobalSettings;
  43. private:
  44. bool m_enabled = true;
  45. };
  46. } // namespace Hair
  47. } // namespace Render
  48. } // namespace AZ