/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #include "LmbrCentral_precompiled.h" #if ENABLE_CRY_PHYSICS #include "WindVolumeComponent.h" #include #include #include #include #include #include #include #include "I3DEngine.h" namespace LmbrCentral { void WindVolumeConfiguration::Reflect(AZ::ReflectContext* context) { if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(1) ->Field("Falloff", &WindVolumeConfiguration::m_falloff) ->Field("Speed", &WindVolumeConfiguration::m_speed) ->Field("Air Resistance", &WindVolumeConfiguration::m_airResistance) ->Field("Air Density", &WindVolumeConfiguration::m_airDensity) ->Field("Direction", &WindVolumeConfiguration::m_direction) ; } } void WindVolumeComponent::Reflect(AZ::ReflectContext* context) { WindVolumeConfiguration::Reflect(context); if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(1) ->Field("Configuration", &WindVolumeComponent::m_configuration) ; } #if ENABLE_CRY_PHYSICS if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { behaviorContext->EBus("WindVolumeRequestBus") ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::Preview) ->Attribute(AZ::Script::Attributes::Category, "Physics (Legacy)") ->Event("SetFalloff", &WindVolumeRequestBus::Events::SetFalloff) ->Event("GetFalloff", &WindVolumeRequestBus::Events::GetFalloff) ->Event("SetSpeed", &WindVolumeRequestBus::Events::SetSpeed) ->Event("GetSpeed", &WindVolumeRequestBus::Events::GetSpeed) ->Event("SetAirResistance", &WindVolumeRequestBus::Events::SetAirResistance) ->Event("GetAirResistance", &WindVolumeRequestBus::Events::GetAirResistance) ->Event("SetAirDensity", &WindVolumeRequestBus::Events::SetAirDensity) ->Event("GetAirDensity", &WindVolumeRequestBus::Events::GetAirDensity) ->Event("SetWindDirection", &WindVolumeRequestBus::Events::SetWindDirection) ->Event("GetWindDirection", &WindVolumeRequestBus::Events::GetWindDirection) ; } #endif } WindVolumeComponent::WindVolumeComponent(const WindVolumeConfiguration& configuration) : m_configuration(configuration) { } void WindVolumeComponent::Activate() { WindVolume::Activate(GetEntityId()); } void WindVolumeComponent::Deactivate() { WindVolume::Deactivate(); } } // namespace LmbrCentral #endif // ENABLE_CRY_PHYSICS