// Use this for initialization
 void Start()
 {
     if (controller == null)
     {
         controller = GetComponent <OmicronController>();
     }
 }
Exemple #2
0
 // Parses Omicron Input Data
 public override void OnEvent(EventData e)
 {
     //Debug.Log("CAVE2Manager_Legacy: '"+name+"' received " + e.serviceType);
     if (e.serviceType == EventBase.ServiceType.ServiceTypeMocap)
     {
         if (!mocapSensors.ContainsKey((int)e.sourceId))
         {
             OmicronMocapSensor mocapManager = gameObject.AddComponent <OmicronMocapSensor>();
             mocapManager.sourceID = (int)e.sourceId;
             if (CAVE2.GetCAVE2Manager().usingKinectTrackingSimulator)
             {
                 mocapManager.positionMod = new Vector3(1, 1, -1);
             }
             mocapSensors[(int)e.sourceId] = mocapManager;
         }
     }
     else if (e.serviceType == EventBase.ServiceType.ServiceTypeWand)
     {
         if (!wandControllers.ContainsKey((int)e.sourceId))
         {
             OmicronController wandController = gameObject.AddComponent <OmicronController>();
             wandController.sourceID          = (int)e.sourceId;
             wandControllers[(int)e.sourceId] = wandController;
         }
     }
 }
Exemple #3
0
 public bool GetButtonUp(int wandID, CAVE2.Button button)
 {
     if (wandControllers.ContainsKey(wandID))
     {
         OmicronController wandController = (OmicronController)wandControllers[wandID];
         return(wandController.GetButtonState(button) == OmicronController.ButtonState.Up);
     }
     return(false);
 }
Exemple #4
0
 public OmicronController.ButtonState GetButtonState(int wandID, CAVE2.Button button)
 {
     if (wandControllers != null && wandControllers.ContainsKey(wandID))
     {
         OmicronController wandController = (OmicronController)wandControllers[wandID];
         return(wandController.GetButtonState(button));
     }
     return(OmicronController.ButtonState.Idle);
 }
Exemple #5
0
 public float GetAxis(int wandID, CAVE2.Axis axis)
 {
     if (wandControllers.ContainsKey(wandID))
     {
         OmicronController wandController = (OmicronController)wandControllers[wandID];
         float             axisValue      = wandController.GetAxis(axis);
         if (Mathf.Abs(axisValue) <= axisDeadzone)
         {
             axisValue = 0;
         }
         return(axisValue);
     }
     return(0);
 }