HairComponentConfig.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 <AzCore/Serialization/SerializeContext.h>
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include <Components/HairComponentConfig.h>
  11. #include <Rendering/HairGlobalSettingsBus.h>
  12. namespace AZ
  13. {
  14. namespace Render
  15. {
  16. namespace Hair
  17. {
  18. void HairComponentConfig::Reflect(ReflectContext* context)
  19. {
  20. AMD::TressFXSimulationSettings::Reflect(context);
  21. AMD::TressFXRenderingSettings::Reflect(context);
  22. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  23. {
  24. serializeContext->Class<HairComponentConfig, ComponentConfig>()
  25. ->Version(4)
  26. ->Field("HairAsset", &HairComponentConfig::m_hairAsset)
  27. ->Field("SimulationSettings", &HairComponentConfig::m_simulationSettings)
  28. ->Field("RenderingSettings", &HairComponentConfig::m_renderingSettings)
  29. ->Field("HairGlobalSettings", &HairComponentConfig::m_hairGlobalSettings)
  30. ;
  31. }
  32. }
  33. void HairComponentConfig::OnHairGlobalSettingsChanged()
  34. {
  35. HairGlobalSettingsRequestBus::Broadcast(&HairGlobalSettingsRequests::SetHairGlobalSettings, m_hairGlobalSettings);
  36. }
  37. } // namespace Hair
  38. } // namespace Render
  39. } // namespace AZ