EN

# 五、SDK示例

# 5.1 QiyuVR_NativeActivity

QiyuVR_NativeActivity示例展示了使用OpenGL ES的Android Native工程。示例场景中展示了简单的茶壶模型、手柄操作、ReCenter等功能。QiyuVR_NativeActivity_fmod和QiyuVR_NativeActivity类似,简单测试了加入fmod音频库并播放声音。

 ************************************************
 *ATTENTION! <TriggerR> <<Right Controller>> to Switch the TestGroup(refer to 'enum TestGroup').
 ************************
 *TestGroup*:<<< TG_Default >>>
 **<<Right Controller>>
 ***<GripR> 	- vibrate this controller(amplitude:0.5f, duration:200.0f);
				  test FMOD, playSound2.
 ***<Press_A> 	- qiyu_SetTrackingOriginMode, switch between GroundMode and DeviceMode.
				  test FMOD, playSound3.
 ***<Press_B> 	- switch between 4 qiyu_FoveationLevel(FL_None, FL_Low, FL_Medium, FL_High, FL_Custom).
 **<<Left Controller>>
 ***<TriggerL>	- vibrate this controller(amplitude:1.0f, duration:4.0f).
 				  test FMOD, playSound1.
 ***<GripL>		- stop vibrate this controller. (press to rotate the teapot; release will stop the teapots.);
 ***<Press_X> 	- test eye buffer size changed. switch between scale 0.7f and 0.2f.
 ***<Press_Y> 	- swith between MultiView and MultiPass. when MultiView test color is Red/Green for Left/Right eye.
 ************************
 *TestGroup*:<<< TG_QiyuPlatform >>>
 **<<Right Controller>>
 ***<Press_A> 	- test__qiyu_Platform_Init
 ***<Press_B> 	- test__qiyu_Platform_GetAccountInfo
 **<<Left Controller>>
 ***<GripL> 	- test__qiyu_Platform_GetDeepLink
 ***<Touch_X> 	- test__qiyu_Platform_IsAccountLogin
 ************************
 *TestGroup*:<<< TG_QiyuPrefs >>>
 **<<Right Controller>>
 ***<Press_A> 	- test__init_QiyuPrefs
 ***<Press_B> 	- test__set_QiyuPrefs
 ***<Touch_B> 	- test__get_QiyuPrefs
 **<<Left Controller>>
 ***<Press_X> 	- test__hasKey_QiyuPrefs
 ***<Press_Y> 	- test__delKey_QiyuPrefs
 ***<TriggerL> 	- test__delALL_QiyuPrefs
 ***<GripL> 	- test__save_QiyuPrefs
 ************************
 *TestGroup*:<<< TG_Boundary >>>
 **<<Right Controller>>
 ***<Press_B>	- qiyu_GetBoundaryGeometry.
 **<<Left Controller>>
 ***<TriggerL>	- qiyu_GetBoundaryDimensions.
 ***<Press_X> 	- qiyu_IsBoundaryVisible.
 ***<Press_Y> 	- qiyu_IsBoundaryBelowHeadVisible.
 ************************
 ************************************************

# 5.2 teapots\more-teapots

取自:https://github.com/android/ndk-samples.git (opens new window)

将其中的more-teapots改为VR模式予以展示。

建议使用该例子中的方式加载库,即:

在void android_main(android_app* state)函数中使用ndk_helper::JNIHelper::GetInstance()->Init(state->activity, HELPER_CLASS_NAME, "qiyuapi");来加载库。