Function rrise::query_params::get_rtpc_value
source · [−]pub fn get_rtpc_value<'a, T: Into<AkID<'a>>>(
rtpc_id: T,
on_game_obj: Option<AkGameObjectID>,
on_playing_id: Option<AkPlayingID>,
requested_scope: RtpcValueType
) -> Result<RtpcValueType, AkResult>Expand description
Get the value of a real-time parameter control.
An RTPC can have a any combination of a global value, a unique value for each game object, or a unique value for each playing ID.
The value requested is determined by requested_scope, on_game_obj and on_playing_id.
If a value at the requested scope is not found, the value that is available at the the next broadest scope will be returned.
Remark
When looking up RTPC values via playing ID (ie.
requested_scopeis RtpcValueType::PlayingID),on_game_objcan be set to a specific game object (if it is available to the caller) to use as a fall back value. If the game object is unknown or unavailable, None or AK_INVALID_GAME_OBJECT can be passed inon_game_obj, and the game object will be looked up viaon_playing_id.
However in this case, it is not possible to retrieve a game object value as a fall back value if the playing id does not exist. It is best to pass in the game object if possible.
on_game_objis ignored ifrequested_scopeis RtpcValueType::Global
on_playing_idis ignored ifrequested_scopeis not RtpcValueType::PlayingID
Return
- The scoped requested value if succeeded.
- AkResult::AK_IDNotFound if the game object was not registered or the RTPC name could not be found.
- AkResult::AK_Fail if the RTPC value could not be obtained.
See also RtpcValueType