RtpcValue¶
struct RtpcValue
A RTPC compatible value is used as a wrapper to hold property values * that can be linked to RTPCs.
A property value that can be linked to a RTPC can be either a single static value that never updates, or a curve and an RTPC value that is updated by the game. The curve is used here as a function that takes the current RTPC value and returns the parameter value.
Functions¶
Name | Description |
---|---|
RtpcValue | Creates an uninitialized RtpcValue object. |
RtpcValue | Creates a copy of the RtpcValue object. |
~RtpcValue | Destroys the RtpcValue object. |
Init | Creates a RtpcValue object with a static value. |
Init | Creates a RtpcValue object with a curve and an RTPC object. |
Init | Creates a RtpcValue object from an asset definition. |
GetValue | Gets the current RTPC value. For static values, this will always * return the value passed to the constructor or set from an asset definition. |
IsStatic | Checks if the RTPC value is static. |
Function Details¶
GetValue¶
[[nodiscard]] AmReal32 GetValue() const
Gets the current RTPC value. For static values, this will always * return the value passed to the constructor or set from an asset definition.
- Return
- The current RTPC value.
Init¶
void Init(AmReal32 value)
Creates a RtpcValue
object with a static value.
- Parameter
value
- The static value to set.
void Init(const Rtpc* rtpc, Curve* curve)
Creates a RtpcValue
object with a curve and an RTPC object.
- Parameter
rtpc
- The RTPC to link to.
- Parameter
curve
- The curve to use.
void Init(const RtpcCompatibleValue* definition)
Creates a RtpcValue
object from an asset definition.
- Parameter
definition
- The RTPC-compatible value asset definition.
IsStatic¶
[[nodiscard]] bool IsStatic() const
Checks if the RTPC value is static.
- Return
true
if the RTPC value is static,false
otherwise.
RtpcValue¶
RtpcValue()
Creates an uninitialized RtpcValue
object.
An uninitialized RtpcValue
object cannot be used to update values.
RtpcValue(const RtpcValue& other)
Creates a copy of the RtpcValue
object.
- Parameter
other
- The
RtpcValue
object to copy.
~RtpcValue¶
~RtpcValue()
Destroys the RtpcValue object.