WaveVR_Arena

Contents

Sample

WaveVR provides APIs of arena that you can use to set up a round or rectangle range to inform limited movement range.

In the sample Assets/Samples/PoseTracker_Test, we provide a sample script - Arenatest.cs in Scripts/

Open the sample scene PoseTracker_Test in Scene/ and look in the WaveVR inspector:

_images/ArenaTest01.png _images/ArenaTest02.png

You can choose the round or rectangle mode and set up the diameter of the round or the width/length of the rectangle.

When a player comes close to the arena boundary, the virtual wall is shown:

_images/arena01.png

The arena feature is not supported in editor mode.

Usage

WaveVR provides 5 APIs for the arena and the ArenaTest.cs script 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: The virtual wall is shown when a player 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 player is beyond the arena range.
bool _overrange = Interop.WVR_IsOverArenaRange ();