Scene Prefabs
This section describes the Unity prefabs of the VIRNECT Track package. These prefabs can be added with the VIRNECT Track | GameObject menu:
TrackManager
-
Scene Camera
When the
TrackManager
is added, the main scene camera will be referenced automatically. Also aTrackCamera
component will be added to this main camera. If this cannot be done automatically the framework will notify you to reference to the main camera manually. -
Image Source
VIRNECT Track supports 2 different image sources:
Camera
You can use a USB camera in the Unity editor or in native platform applications.
If multiple cameras are attached to your device, you can select the camera of your choice from the
USB Camera ID
field in theTrackManager
. This field contains the camera device IDs, which refer to the index of all available cameras, starting from index 0.Attention
When you build your Unity project for Android platforms, the device embedded back-facing camera will be used.
File Sequence
A file sequence can be used instead of the camera to ease development, or debug your application with reproducible movements. When file sequence is selected, the
File Sequence Path
needs to be provided. Optionally a calibration file can be specified that represents the intrinsic parameters of the camera used for recording the sequence.To record such sequences, the Recorder UI can be used.
Target
All targets that you want to track in a scene need to be referenced by a Target
prefab before building the application.
Targets can be added by using the Menu VIRNECT Track | GameObject | Target.
The Target
prefab provides several different options:
-
Target
To associate the GameObject with a physical target you can select the appropriate target name from theTarget
drop down. This list will only show targets that are present in the Assets/StreamingAssets/trackAssets/trackTargets/ folder. The selected value cannot be changed during runtime. -
Hide target visualization
A tracked physical target is visualized with a virtual plane. The initial size of this plane is 0.1 units in unity which represents 10 cm. At runtime this plane will represent the actual physical size of the target, which was defined during target training. Changing this option will show or hide this plane accordingly. -
Ignore target during tracking
This option can be used to dynamically exclude targets from tracking. If there is no need to track a specific target, the computational load can be reduced with applying this option. To test the dynamic exclusion, the Active Target Manager UI can be used.
To change the standard appearance of a target, simply attach any GameObject as a child to this Target
in the scene graph.
Info
Since the Track framework uses real world scale reference, you might need to scale your GameObjects accordingly.
1 unit in Unity = 1 meter in real world
The default target placeholder has a size of 10 by 10 cm in the editor.
During runtime it will scale according to the settings defined during target training.
Warning
Currently the Track framework does not support dynamic spawning of Target
GameObjects.
Dynamic loading of sub-scenes will only work correctly if all Track related GameObjects are present in one scene.