-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Last revision: 2 February 2016
For latest documentation: https://github.com/uic-evl/omicron-unity/wiki
Unity Version: 5.2.3
getReal3D Version: 3.2.3
The Omicron-Unity module is a Unity package designed to aid in the development Unity applications for the CAVE2(TM) Hybrid-Reality environment developed by the Electronic Visualization Laboratory (EVL) at the University of Illinois at Chicago (UIC).
Omicron SDK is a C++ library used to provide a variety of input devices to immersive applications. This module primarily uses Omicron to receive Mocap and Controller information from the CAVE2 tracking system. More experimental components also use multi-touch, or Kinect information (Skeleton tracking and Voice Recognition).
Module-Omicron is designed to be added as a submodule to an existing Unity project using a Git repository. For a fully packaged Unity project, see https://github.com/arthurnishimoto/omicron-unity.
This module provides examples and tools for aiding the developing Unity applications for CAVE2. Many of the tools are geared toward simulating the user tracked capabilities of the CAVE2 system in order to minimize the need to test basic interaction functionality directly on CAVE2. The major components of this module are:
- OmicronManager - Connects to the Omicron input server to provide access to various input devices
- CAVE2Manager - Manages input events and provides 'CAVE2 Simulator Mode' tools for offline development
- OmicronPlayerController - PlayerController designed to take advantage of the user-tracked virtual environment
OmicronManager serves as a lightweight wrapper for the Omicron library. It handles socket communication with an Omicron oinputserver and processes the events for use by CAVE2Manager within Unity.
In general for CAVE2 applications you do NOT need to use the OmicronManager to connect to the CAVE2 tracking system. Basic CAVE2 inputs such as Head tracking, wand tracking, and wand button inputs are handled by the getReal3D plugin.
However if you need more advanced input devices supported by the Omicron C++ library such as touchscreens, Kinect sensors, or brainwave headsets, then you will need to use the OmicronManager to connect to Omicron's oinputserver. The oinputserver will need to be configured to use the Kinect, touch, etc. data. This module will only receive and decode what the server is capable of sending.
CAVE2 Manager handles the bulk of processing incoming Omicron or getReal3D events for use in Unity. It also provides a number of options to simulate head and wand tracking and emulate CAVE2 controller inputs using Unity's Input manager.
The CAVE2Manager.cs script contains a number of public variables which can be used to configure controller mappings and simulator settings.
Variable | Type | Function |
---|---|---|
Simulator Mode | Boolean | Enables/disables keyboard mapping to CAVE2 inputs. Mapping is configured later on. |
Wand 1 Tracking Offset | Vector3 | The offset position of wand 1's mocap position to the virtual wand object (useful for aligning objects to appear in the user's hand) |
Keyboard Event Emulation | Boolean | Toggles keyboard to wand events (Automatic if Simulator Mode is true) |
Mocap Emulation | Boolean | Toggles head/wand emulation (Automatic if Simulator Mode is true) |
Lock Wand to Head Transform | Boolean | Set the wand pos/rot to match the head |
Mouse Head Look | Boolean | Head emulated rotation controlled by mouse |
Head Emulated Position | Vector3 | Tracker space position of the head |
Head Emulated Rotation | Vector3 | Tracker space pitch/yaw/roll of the head |
Wand Emulated Position | Vector3 | Tracker space position of the wand |
Wand Emulated Rotation | Vector3 | Tracker space pitch/yaw/roll of the wand |
Default Wand Emulation Mode | enum TrackerEmulationMode | Set the wand keyboard/mouse behavior |
Toggle Wand Emulation Mode | enum TrackerEmulationMode | Set the alternate wand keyboard/mouse behavior |
Toggle Wand Mode Key | KeyCode | Key used to toggle between default and alternate wand emulation modes |
Wand Mode Toggled | Boolean | Read Only: Status of wand emulation mode toggle |
IJKL keys | enum Head/Wand/CAVE | Sets which object is controlled by the IJKL keys |
IJKL key Mode | enum TrackerEmulationMode | Sets the IJKL emulation mode type |
Emulated Translate Speed | float | |
Emulated Rotation Speed | float | |
Framerate Cap | int | |
Camera Controller | Game Object | |
Wand Simulator Analog UD | String | Unity InputManager Axis to map to Wand analog stick Up/Down |
Wand Simulator Analog LR | String | Unity InputManager Axis to map to Wand analog stick Left/Right |
Wand Simulator Button 3 | String | Unity InputManager Axis to map to Wand Button 3 (Cross) |
Wand Simulator Button 2 | String | Unity InputManager Axis to map to Wand Button 2 (Circle) |
Wand Simulator D Pad Up | KeyCode | Key mapping to Wand button |
Wand Simulator D Pad Down | KeyCode | Key mapping to Wand button |
Wand Simulator D Pad Left | KeyCode | Key mapping to Wand button |
Wand Simulator D Pad Right | KeyCode | Key mapping to Wand button |
Wand Simulator Button 5 | KeyCode | Key mapping to Wand button 5 (L1) |
Wand Simulator Button 6 | String | Unity InputManager Axis to map to Wand button 6 (L3) |
Wand Simulator Button 7 | KeyCode | Key mapping to Wand button 7 (L2) |
Look Vertical | float | |
Look Horizontal | float |
The Omicron Player Controller, through the inputs provided by CAVE2 Manager, is designed to provide programmers with a Player Controller which should behave the same on a development laptop and on CAVE2. The controller provides three modes of interaction (NavModes), similar to what is already used in CAVE2:
- Walk - First-person character controller using gravity and collides with the environment
- Drive - Fly around the environment without gravity or collisions, but without rotational movement. Similar to default Omegalib navigation.
- Freefly - Same as drive except pitch, yaw, and roll is enabled. Same as Freefly mode in Omegalib or the Mars or Constellations CAVE2 demos.
In addition to these NavModes, the Forward Reference of the Player Controller can be specifed:
- CAVE - The forward direction is based on the front of the CAVE2 displays.
- Head - Uses the direction the primary head-tracked user is facing as the forward direction.
- Wand- Uses the direction the primary wand is facing as the forward direction.
Unlike other player controllers, the Omicron Player Controller's collider is based on the position of the tracked user's position in the CAVE2 environment rather than the center of CAVE2.
Unity applications in CAVE2 uses the getReal3D for Unity plugin by Mechdyne Corporation. This module has a number of #if USING_GETREAL3D defines and #else alternatives. This allows the Omicron-Unity module to be used to develop CAVE2 applications without needing the getReal3D plugin or a Unity 4 professional license until testing on CAVE2.
Before deployment on CAVE2, the USING_GETREAL3D compiler flags must be enabled. This is done by going to File/Build Settings/Player Settings/PC, Mac & Linux Standalone/Other Settings/Configuration/Scripting Define Symbols.
Add USING_GETREAL3D
to the text field.
Details on this process can be found in the Unity Manual on Platform Dependent Compilation under Platform Custom Defines.
[Customizing inputs here]
[Stuff goes here]
[The stuff where stuff goes here]
Mocap IDs correspond to the unique configuration of the silver retro reflective markers found on the various tracking devices. The unique marker configuration is recorded and given a string name using the Vicon Tracker software located on the CAVE2 tracking machine. Mechdyne's trackD server read these string names and applies an integer ID to them.
In general these integer IDs are all you need for configuring your application, unless you want to create a new tracked object.
As of February 2, 2016, these are the current tracked objects and their corresponding mocap IDs:
While mocap IDs are fixed based on the object they're associated with, controller IDs are more dynamic. This is because controller IDs are typically assigned based on the order in which they are connected to the tracker.
CAVE2 is a trademark of the University of Illinois Board of Trustees