WaveVR_PoseTracker

A new version can be found here: WaveVR_PoseTracker

Introduction

WaveVR provides two scripts for tracking poses:

  • WaveVR_DevicePoseTracker.cs
  • WaveVR_ControllerPoseTracker.cs

For common use, you will usually use WaveVR_DevicePoseTracker to track a device pose.

WaveVR_ControllerPoseTracker is usually used to track a controller pose and we use it in all controller prefabs.

Friendly reminder: Please DO NOT add both components in the same Game Object.

Resources

Prefab

  • WaveVR is located in Assets/WaveVR/Prefabs/
  • Generic Controller is located in Assets/WaveVR/Resources/Controller/
  • Specified Controller is located in Assets/ControllerModel/Finch/Resources/Controller/ and Assets/ControllerModel/Link/Resources/Controller/

Scripts

  • WaveVR_DevicePoseTracker is located in Assets/WaveVR/Scripts/TrackingPose/
  • WaveVR_ControllerPoseTracker is located in Assets/WaveVR/Scripts/TrackingPose/

Sample Scene

  • PoseTracker_Test is located in Assets/Samples/PoseTracker_Test/Scene/
  • HelloVR is located in Assets/Samples/HelloVR/

How to Use

Scene Management

  1. Open the sample scene PoseTracker_Test.
_images/wavevr_posetracker01.jpg
  1. Look in the Inspector of Cube. WaveVR_DevicePoseTracker is used here to receive the pose event and update the cube pose.

    The Type is used to set the controller types.

_images/wavevr_posetracker03.jpg
  1. WaveVR_ControllerPoseTracker is used in the prefab vr_controller_tank_0_8_6DOF_MC_R
_images/wavevr_posetracker02.jpg

Editor Mode

In editor mode, use the mouse and keyboard to simulate the controller.

For the head:

  • Left Ctrl + mouse: roll
  • Left Alt + mouse: yaw and pitch
  • Left Shift + mouse: move (X,Y) position
  • Left Shift + mouse scroll wheel: move Z position

For the right controller:

  • Right Ctrl + mouse: roll
  • Right Alt + mouse: yaw and pitch
  • Right Shift + mouse: move (X,Y) position
  • Right Shift + mouse scroll wheel: move Z position
  • Mouse right button: press button

For the left controller:

  • Mouse left button: touch button

Script

There is a Timing option in the pose tracker scripts.

If you choose When New Poses, the device pose will be updated before rendering.

If you choose ``When Update`, the device pose will be updated at the end of each frame.

WaveVR_DevicePoseTracker and WaveVR_ControllerPoseTracker listen to event MSG_NEW_POSES in OnEnable

void OnEnable()
{
    WaveVR_Utils.Event.Listen(MSG_NEW_POSES, OnNewPoses);

The pose of an object will be updated in each frame in OnNewPoses.

Also, you can see the Inverse Pos and Inverse Rotation options. They are used to inverse the position and rotation of the pose.

For example, when you are looking at a ball and moving left, the ball looks like its moving in the opposite direction (moving to the right).

For advanced uses of inverse, refer to Samples/SeaOfCube/Scenes/SeaOfCube

WaveVR_PoseTracker is a simple script to track the controller pose.

It does not detect the connection status of the controller but only works when the controller with the specified Type is connected.