WVR_ReleaseCtrlerModelAnimNodeData¶
-
WVR_EXPORT void WVR_ReleaseCtrlerModelAnimNodeData(WVR_CtrlerModelAnimData_t ** ctrlModelAnimData)
Use this function to deallocate the memory used for the controller animation.
Delete the animation data received from WVR_GetCtrlerModelAnimNodeData.
- Version
- API Level 7
- Parameters
ctrlModelAnimData
: An allocated object about animation data. The object will be destroyed and the structure cleared(ctrlModelAnimData will be set nullptr).
How to use¶
See the example below:
std::function<void()> loadModelFunc = [this](){
if (mCachedData != nullptr) {
WVR_ReleaseControllerModel(&mCachedData); //we will clear cached data ptr to nullptr.
}
WVR_Result result = WVR_GetCurrentControllerModel(mCtrlerType, &mCachedData);
if (result == WVR_Success) {
//It represent ok, set a flag to notify graphics initialization in render thread.
// Get API data.
WVR_CtrlerModelAnimData_t *animData = nullptr;
result = WVR_GetCtrlerModelAnimNodeData(mCtrlerType, &animData);
if (result == WVR_Success) {
//To Do : to initialize pose data.
//........
//Release after inititalization.
WVR_ReleaseCtrlerModelAnimNodeData(&animData);
}
}
};
The full example is in the Controller class of the wvr_native_hellovr sample.