WVR_SetControllerPoseMode

WVR_EXPORT bool WVR_SetControllerPoseMode(WVR_DeviceType type, WVR_ControllerPoseMode mode)

Function to set controller pose mode to adjust the controller ray.

Return
True means assigned mode enabled successfully; False means assigned mode is unsupported or the same as default mode (WVR_ControllerPoseMode_Raw).
Version
API Level 6
Parameters
  • type: Indicates what device type. (refer to WVR_DeviceType). This should be the controller type.
  • mode: Indicates what controller pose mode (refer to WVR_ControllerPoseMode).

How to use

  1. This API is used to change the controller raw pose for different usage situations.
    • Raw mode: The controller pose remains raw (unchanged).
    • Trigger mode: Use controller as gun.
    • Panel mode: Normal usage.
    • Handle mode: Use controller as sword.
  2. Here is an example for the function:
#include <wvr/wvr_device.h>
#include <wvr/wvr_types.h>
/* Set right controller model as sword usage in the scene of VR content
   by setting right controller pose "Handle" mode. */
WVR_DeviceType type = WVR_DeviceType_Controller_Right;
WVR_ControllerPoseMode mode = WVR_ControllerPoseMode_Handle;
bool result = WVR_SetControllerPoseMode(type, mode);

/* Set right controller model as gun usage in the scene of VR content
   by setting right controller pose "Trigger" mode. */
mode = WVR_ControllerPoseMode_Trigger;
result = WVR_SetControllerPoseMode(type, mode);

/* Set right controller model as normal usage in the scene of VR content
   by setting right controller pose "Panel" mode. */
mode = WVR_ControllerPoseMode_Panel;
result = WVR_SetControllerPoseMode(type, mode);

/* Set right controller model back to "default" in the scene of VR content
   by setting right controller pose "Raw" mode. There would be no offset
   adjustment in controller model. */
mode = WVR_ControllerPoseMode_Raw; // default
result = WVR_SetControllerPoseMode(type, mode);