DINO-Unity21
Sample Unity 2021 Project for HL2-DINO
Loading...
Searching...
No Matches
UnityToolManager Class Reference
Inheritance diagram for UnityToolManager:
[legend]
Collaboration diagram for UnityToolManager:
[legend]

Public Member Functions

void EnqueueTrackingData (double[] matTransforms)
 Public function to dump the latest encoded double array received from HL2-DINO-DLL.
 
IReadOnlyDictionary< int, TrackedToolGetToolDictionary ()
 Get a copy of the dictionary to print elsewhere or to analyse.
 

Public Attributes

List< TrackedToolToolsTrackedByHololens
 Axis to flip when converting from right-handed (HL2 Research Mode) to left-handed (Unity). This needs to be universally consistent everywhere you pass info in and out of Unity. So all right-handed information flowing into the app should be inverted in this direction. Similarly, to convert it to right-handed when flowing out of Unity to some other app, invert in the direction you have specified.
 
Dictionary< int, TrackedToolToolDictionary = new Dictionary<int, TrackedTool>()
 Stashes information about each tool we can see. Entries are initialised based on members contained in ToolsTrackedByHololens on startup. During runtime this dictionary will be updated based on info received from HL2-DINO-DLL.
 

Private Member Functions

void Start ()
 
void InitialiseToolDictionary ()
 
void Update ()
 
void UpdateHologramPositions ()
 Reads entries of the internal tool dictionary, and then updates GameObject transforms accordingly.
 
void UpdateTrackedToolDictionary ()
 Check if there has been any new information dumped to the member variable LatestDoubleArray, if so, then update our internal dictionary.
 

Private Attributes

readonly object toolDictLock = new object()
 
System.Diagnostics.Stopwatch ScriptTimer = new System.Diagnostics.Stopwatch()
 
double[] LatestDoubleArray
 A double array to dump the latest encoded message from the HL2 into.
 
readonly object doubleArrayLock = new object()
 
volatile bool NewToolArrayReceived
 

Member Function Documentation

◆ EnqueueTrackingData()

void UnityToolManager.EnqueueTrackingData ( double[]  matTransforms)
inline

Public function to dump the latest encoded double array received from HL2-DINO-DLL.

Parameters
matTransformsEncoded information about tool poses and visibility

◆ GetToolDictionary()

IReadOnlyDictionary< int, TrackedTool > UnityToolManager.GetToolDictionary ( )
inline

Get a copy of the dictionary to print elsewhere or to analyse.

Returns
Internally stored tool dictionary

Member Data Documentation

◆ ToolsTrackedByHololens

List<TrackedTool> UnityToolManager.ToolsTrackedByHololens

Axis to flip when converting from right-handed (HL2 Research Mode) to left-handed (Unity). This needs to be universally consistent everywhere you pass info in and out of Unity. So all right-handed information flowing into the app should be inverted in this direction. Similarly, to convert it to right-handed when flowing out of Unity to some other app, invert in the direction you have specified.

List of structs which describe the tools the headset tracks. Used as both an input to the DLL (to describe the geometries of tools we track) and also used to cache GameObject transforms, so we can move around holograms based on data we receive from the HL2. This should be configured and properly set up prior to app compilation and deployment.


The documentation for this class was generated from the following file: