You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/AtomTressFX/Code/Components/HairComponentConfig.cpp

48 lines
1.6 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <Components/HairComponentConfig.h>
#include <Rendering/HairGlobalSettingsBus.h>
namespace AZ
{
namespace Render
{
namespace Hair
{
void HairComponentConfig::Reflect(ReflectContext* context)
{
AMD::TressFXSimulationSettings::Reflect(context);
AMD::TressFXRenderingSettings::Reflect(context);
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<HairComponentConfig, ComponentConfig>()
->Version(4)
->Field("HairAsset", &HairComponentConfig::m_hairAsset)
->Field("SimulationSettings", &HairComponentConfig::m_simulationSettings)
->Field("RenderingSettings", &HairComponentConfig::m_renderingSettings)
->Field("HairGlobalSettings", &HairComponentConfig::m_hairGlobalSettings)
;
}
}
void HairComponentConfig::OnHairGlobalSettingsChanged()
{
HairGlobalSettingsRequestBus::Broadcast(&HairGlobalSettingsRequests::SetHairGlobalSettings, m_hairGlobalSettings);
}
} // namespace Hair
} // namespace Render
} // namespace AZ