(Last updated 21/07/2018)

This package represent the connection to VR Tracker system. It includes UDP and WebSocket clients, but also Tag scripts.

Package Overview

Network

Plugins

websocket-sharp : the websocket dll library for Windows, OSX, Android (maybe iOS too)

Prefabs

VRTracker : prefab to drop in the scene that handles the connection with VR Tracker system.

Scripts

VRT_Manager.cs : The main manager handling the Tags and all the communications. It links everything together. This script is a Singleton.

VRT_WebsocketClient.cs : this script handles the Websocket communication with the Gateway (port 7777)

VRT_UDPClient.cs : this script handles the UDP packages reception from the Gateway and Tags (port 7778)

VRT_Tag.cs : represents a Tag. It receives the data from the Tag with the corresponding type.

VRT_TagGun.cs : specific extension of VRT_Tag for the Gun and controller tracking. It has more dead reckoning and shows less latency.

VRT_TagHead.cs : specific extension of VRT_Tag for the Head tracking, with less dead reckoning but more accuracy.

Introduction

The Manager is the main asset to have in your scene has it handles all the communications with the Gateway. Even if you are using the Simulator, you will need to have a Manager as it defines how many Tags and which typeof Tags you need to track for your player.

NOTE: The Manager has a Dont Destroy on Load, meaning if you load another scene it will still be here (it follows from a Scene to another). Therefore make sure you don't add one in your Pairing AND in your game Scene.

Create a Manager for your needs

The VRTracker prefab ******is a good example to base your manager on. The parent GameObject always need to have the same scripts (VRT_Manager, VRT_WebsocketClient, VRT_UDPClient)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/cf98ec1b-7cdb-4c4a-a607-ab67e88fc4b9/Capturedecran2018-04-20a16.04.10.png

Then all you need to do is add children GameObjects for each Tag the player needs. In this case we have a Tag for the head, one the gun and one for a hand. Those children GameObject only require a script of type VRT_Tag, and you have to set the right Tag Type using the selector (so the VRT_FollowTag scripts can listen to the Tag data with the same Tag Type)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f04bbda7-717d-4f94-b327-21c69d8ac34e/Capturedecran2018-04-20a16.05.20.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b534ebd1-0b9d-4d42-ba7c-51cb87d5a564/Capturedecran2018-04-20a16.05.26.png

More on VRT_Manager

Singleton

The VRT_Manager can be accessed from any script as it is a Singleton pattern (only one instance can exist). It is accessible by calling :

VRTracker.Manager.VRT_Manager.instance

Actions

public event Action<string> OnAvailableTag; // Called when a Tag is available on the Gateway

Websocket and UDP