WVR_GetCurrentNaturalHandModel

WVR_EXPORT WVR_Result WVR_GetCurrentNaturalHandModel(WVR_HandRenderModel_t ** handModel)

Use this function to get the natural hand devices.

Note: It is not recommended to call this function after we get controller model.

Version
API Level 7
Parameters
  • handModel: (Output) A double pointer for receiving the natural hand model. The SDK will allocate the data structure for the natural hand model and write the address into handModel.
Return Value
  • WVR_SUCCESS: The natural hand model was successfully retrieved from the currently connected device.
  • WVR_Error_InvalidArgument: If handModel is nullptr or pointer in *handModel isn’t nullptr.
  • WVR_Error_SystemInvalid: The SDK can’t get the hand model since the system has not yet been initialized.
  • WVR_Error_InvalidRenderModel: The SDK can’t get the hand model since the connect between hand component and app has not yet been initialized.

How to use

Try the example below:

WVR_HandRenderModel_t *renderModel = nullptr;
WVR_GetCurrentNaturalHandModel(&renderModel);

if (renderModel != nullptr) {
    mHandObjs[Hand_Left]->loadModel(&(*renderModel).left);
    mHandObjs[Hand_Right]->loadModel(&(*renderModel).right);
    mHandAlphaTex = Texture::loadTextureFromBitmapWithoutCached((*renderModel).handAlphaTex);
    mHandObjs[Hand_Left]->setTexture(mHandAlphaTex);
    mHandObjs[Hand_Right]->setTexture(mHandAlphaTex);

    WVR_ReleaseNatureHandModel(&renderModel);
}