WVR_StartScenePerception¶
-
WVR_EXPORT WVR_Result WVR_StartScenePerception(WVR_ScenePerceptionTarget target)
Function is used to start scene perception with the target parameter.
This API will start scene perception related to the input perception target. Developers can use corresponding APIs to get related data. For example, when developers start scene perception with WVR_ScenePerceptionTarget_2dPlane, they can get 2dPlane data by calling WVR_GetScenePlanes API. Otherwise, if the WVR_ScenePerceptionTarget_2dPlane is stopped, the underlying related resources will be released.
- Version
- API Level 11
- Parameters
target
: the perception target that developers would like to use. (refer to WVR_ScenePerceptionTarget)
- Return Value
WVR_Success
: Start scene perception successfully.others
: WVR_Result mean failure.
If you want to use WVR_StartScenePerception with WVR_ScenePerceptionTarget_SceneMesh target, you need declare and grant the permission wave.permission.GET_SCENE_MESH in AndroidManifest.xml.
<uses-permission android:name="wave.permission.GET_SCENE_MESH" />
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 scene perception with WVR_ScenePerceptionTarget_2dPlane failed
}
// ...
WVR_StopScenePerception(WVR_ScenePerceptionTarget_2dPlane);
WVR_StopScene();
} else {
// start scene failed!
}