WaveVR_Arena¶
Contents |
Sample¶
WaveVR provides APIs for arena that developers can use to set up a round or rectangle range to inform limited movement range.
In sample Assets/Samples/PoseTracker_Test, we provide a sample script - Arenatest.cs in Scripts/
Open sample scene PoseTracker_Test in Scene, look in the WaveVR inspector:
Developers can choose round or rectangle mode and set up the diameter or width/length.
When a user comes close to the arena boundary, the virtual wall is shown:
Arena feature is not supported in editor mode.
Usage¶
WaveVR provides 5 APIs for arena and ArenaTest.cs demonstrates how to use them.
- WVR_SetArena: Set the arena type and range.
if (WaveVR.Instance != null)
{
bool _ret = Interop.WVR_SetArena (ref arena);
if (!_ret)
Log.e (LOG_TAG, "WVR_SetArena failed.");
}
- WVR_GetArena: Get the current arena attributes.
WVR_Arena_t arena = Interop.WVR_GetArena ();
WVR_SetArenaVisible: There are three visibility arena modes: auto, on, and off.
- auto: Virtual wall is shown when a user is 30cm from the virtual wall.
- on: Always show the virtual wall.
- off: Do not show the virtual wall.
Interop.WVR_SetArenaVisible (WVR_ArenaVisible.WVR_ArenaVisible_ForceOn);
- WVR_GetArenaVisible: Get current visibility setting.
WVR_ArenaVisible _visible = Interop.WVR_GetArenaVisible ();
- WVR_IsOverArenaRange: Check whether the user is beyond the arena range.
bool _overrange = Interop.WVR_IsOverArenaRange ();