WVR_GetScenePerceptionState¶
-
WVR_EXPORT WVR_Result WVR_GetScenePerceptionState(WVR_ScenePerceptionTarget target, WVR_ScenePerceptionState * state)
Function is used to get the corresponding perception target state.
Developers can inspect the completion of the scene perception by polling WVR_GetScenePerceptionState. Check state (refer to WVR_ScenePerceptionState) is WVR_ScenePerceptionState_Completed to know the result is ready.
- Version
- API Level 11
- Parameters
target
: input perception target , refer to WVR_ScenePerceptionTargetstate
: the returned WVR_ScenePerceptionState value
- Return Value
WVR_Success
: Get scene perception state successfully.others
: WVR_Result mean failure.
How to use¶
Sample function:
#include <wvr/wvr_scene.h>
if (WVR_StartScene() == WVR_Success) {
if (WVR_StartScenePerception(WVR_ScenePerceptionTarget_2dPlane) == WVR_Success) {
WVR_ScenePerceptionState state;
if (WVR_GetScenePerceptionState(WVR_ScenePerceptionTarget_2dPlane, &state) == WVR_SUCCESS) {
// wait until state is WVR_ScenePerceptionState_Completed
if (state == WVR_ScenePerceptionState_Completed) {
// Start scene perception with WVR_ScenePerceptionTarget_2dPlane successfully and get the state as completed.
// Developers can call WVR_GetScenePlanes to get scene plane data
}
}
} else {
// start perception with WVR_ScenePerceptionTarget_2dPlane failed
}
// ...
WVR_StopScenePerception(WVR_ScenePerceptionTarget_2dPlane);
WVR_StopScene();
} else {
// start scene failed!
}