WVR_TriggerVibration¶
-
WVR_EXPORT void WVR_TriggerVibration(WVR_DeviceType type, WVR_InputId id = WVR_InputId_Max, uint32_t durationMicroSec = 65535, uint32_t frequency = 1, WVR_Intensity intensity = WVR_Intensity_Normal)
Function to trigger vibration.
- Version
- API Level 4
- Note
- Effective with Runtime version 4 or higher
- Parameters
type
: Indicates what device type. (refer to WVR_DeviceType)id
: Indicates the WVR_InputId to trigger vibration.durationMicroSec
: The vibration duration.frequency
: Number of vibration based on durationMicroSec.intensity
: Intensity of the vibration. The default value is WVR_Intensity_Normal
How to use¶
Here is an example for the function:
#include <wvr/wvr_device.h>
// Trigger vibration 2 times per second. Keep the duration for each vibration at 0.5 sec.
WVR_TriggerVibration(WVR_DeviceType_Controller_Left, WVR_InputId_Alias1_Trigger, 1000000, 2, WVR_Intensity_Normal);
Vibrator Intensity includes the following below:
-
enum
WVR_Intensity
¶ Intensity of the vibration.
Values:
-
WVR_Intensity_Weak
= 1¶ Vibration intensity is very weak.
-
WVR_Intensity_Light
= 2¶ Vibration intensity is weak.
-
WVR_Intensity_Normal
= 3¶ Vibration intensity is normal.
-
WVR_Intensity_Strong
= 4¶ Vibration intensity is strong.
-
WVR_Intensity_Severe
= 5¶ Vibration intensity is very strong.
-
Note
- If you would like to use vibrator ability befoer sdk version 3.1.0, using WVR_TriggerVibrator and this is a blocking API. If your sdk version is larger than 3.1.0, use WVR_TriggerVibration instead of original API, this new API is a non-blocking API.