This is a NatNet direct client running in Unity written in C# that allows you to receive tracking data sent from the OptiTrack Motive software directly without intermidiate NatNet SDK server or plug-in. Mostly rewritten from PacketClient.cpp in NatNet SDK and Optirx.
If you just want to see your tracked object appears in Unity, use this. If you want to reduce the tracking network load, use this.
Here are good references for you.
[Check your NatNet Version] (https://www.optitrack.com/downloads/developer-tools.html#natnet-sdk)
- supported Motive 1.0 to 1.9 (NatNet 2.0 to 2.9)
- separated command thread for sending commands and receiving responses from Motive
- separated data thread for receiving tracking data
- a tracking data buffer for keeping historical tracks
- store mappings of unreadable ID to readable names
- switch on/off for displaying debug cubes
- the gameobject in Unity is tagged "tracked" if the object can be recognized by Motive. otherwise it is tagged "untracked".
- Make an empty object in Unity and attach MotiveDirect.cs to it (as shwon in Configuration).
- Make sure you add "tracked" and "untracked" to your Tags in Unity.
There are two easier ways to move your 3D model/gameobject.
- Use Gameobject.Find([name]) and let your 3D model/gameobject follows it.
- Name your 3D model/gameobject as the same name as the rigidbody in Motive. The system then will move your 3D model/gameobject instead of creating a new one.
This project is licensed under the terms of the MIT license.