Function ovr_sys::ovr_SetControllerVibration
source · pub unsafe extern "C" fn ovr_SetControllerVibration(
session: ovrSession,
controllerType: ovrControllerType,
frequency: f32,
amplitude: f32
) -> ovrResult
Expand description
Sets constant vibration (with specified frequency and amplitude) to a controller.
Note: ovr_SetControllerVibration
cannot be used interchangeably with ovr_SubmitControllerVibration
.
This method should be called periodically, vibration lasts for a maximum of 2.5 seconds.
session
Specifies an ovrSession
previously returned by ovr_Create
.
controllerType
The controller to set the vibration to.
frequency
Vibration frequency. Supported values are: 0.0 (disabled), 0.5 and 1.0. Non valid values will be clamped.
amplitude
Vibration amplitude in the [0.0, 1.0]
range.
Returns an ovrResult
for which OVR_SUCCESS(result)
is false upon error and true
upon success. Return values include but aren’t limited to:
* ovrSuccess
: The call succeeded and a result was returned.
* ovrSuccess_DeviceUnavailable
: The call succeeded but the device referred to by controllerType is not available.