33 #ifndef _AK_VALUERAMP_H_
34 #define _AK_VALUERAMP_H_
36 #include <AK/SoundEngine/Common/AkTypes.h>
37 #include <AK/Tools/Common/AkAssert.h>
55 m_fStepIncrement( 0.f ),
71 AkReal32 fStepIncrement,
75 AKASSERT( fStepIncrement > 0.f );
76 m_fStepIncrement = fStepIncrement;
77 m_fCurrent = fInitVal;
88 AkReal32 fDiff = m_fTarget - m_fCurrent;
89 m_uRampLength =
static_cast<AkUInt32
>( fabs(fDiff) / m_fStepIncrement );
90 m_fInc = fDiff > 0 ? m_fStepIncrement : -m_fStepIncrement;
95 AkForceInline AkReal32
Tick()
97 if ( m_uRampCount >= m_uRampLength )
98 m_fCurrent = m_fTarget;
102 m_fCurrent += m_fInc;
112 void SetCurrent(AkReal32 in_fCurrent) { m_fCurrent = in_fCurrent; }
119 void SetRampCount(AkUInt32 in_uRampCount) { m_uRampCount = in_uRampCount; }
124 m_fCurrent = m_fTarget;
125 m_uRampCount = m_uRampLength;
130 AkReal32 m_fStepIncrement;
134 AkUInt32 m_uRampCount;
135 AkUInt32 m_uRampLength;
139 #endif //_AK_VALUERAMP_H_
void StopRamp()
The ramp is no longer necessary; set to target.
void SetCurrent(AkReal32 in_fCurrent)
Set the current interpolated value.
AkForceInline AkReal32 Tick()
CAkValueRamp()
Constructor method.
void RampSetup(AkReal32 fStepIncrement, AkReal32 fInitVal)
Initial parameter interpolation ramp setup.
class AK::CAkValueRamp AK_ALIGN_DMA
~CAkValueRamp()
Destructor method.
AkForceInline void SetTarget(AkReal32 fTarget)
Set the ramp's target value.
void SetRampCount(AkUInt32 in_uRampCount)
Set the current interpolation frame count.
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise