示例#1
0
 /// <summary>
 /// Executes the queued buzz requests (stored in fingersRight/fingersLeft array).
 /// Resets array, because requests are successfully carried out.
 /// </summary>
 void Update()
 {
     if (RightHand)
     {
         senseGloveObjectRight.SendBuzzCmd(fingersRight, 500);
         fingersRight = new int[] { 0, 0, 0, 0, 0 };
     }
     if (LeftHand)
     {
         senseGloveObjectLeft.SendBuzzCmd(fingersLeft, 500);
         fingersLeft = new int[] { 0, 0, 0, 0, 0 };
     }
 }
示例#2
0
        protected override void StartHaptics(HumanBodyBones bodyPart, BodyCoordinateHit hitLocation, float intensity)
        {
#if VRTK_DEFINE_SDK_SENSE_GLOVE
            int fingerIndex = FindHitFingerIndex(bodyPart);

            if (fingerIndex != -1)
            {
                fingers[fingerIndex]     = true;
                intensities[fingerIndex] = (int)(intensity * 100);
                duration[fingerIndex]    = hapticDuration;
            }

            glove.SendBuzzCmd(fingers, intensities, duration);
#endif
        }
示例#3
0
 /// <summary>
 /// Start the buzz motors according to the fingers array.
 /// </summary>
 void Update()
 {
     senseGloveObject.SendBuzzCmd(fingers, 500);
     fingers = new int[] { 0, 0, 0, 0, 0 };
 }
示例#4
0
 /// <summary> SelectionConfirmed to the position of the endPointTracker, but only if it is active on a valid position. </summary>
 public void SelectionConfirmed()
 {
     if (this.IsActive() && this.endPointTracker.activeInHierarchy)
     {
         if (hit.collider.name == "Öffnen" && (guiSave.activeInHierarchy == false))
         {
             senseGlove_Object.SendBuzzCmd(new bool[5] {
                 true, false, false, false, false
             }, 100, 50);
             GameObject.Find("Molekül").GetComponent <EditMode>().editMode = false;
             GameObject.Find("UI0").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("UI1").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("UI2").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("UI3").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("Molekül").SetActive(false);
             this.GetComponent <GlobalCtrl>().loadGUILoad();
             guiLoad.SetActive(true);
         }
         else if (hit.collider.name == "Speichern" && guiSave.activeInHierarchy == false)
         {
             senseGlove_Object.SendBuzzCmd(new bool[5] {
                 true, false, false, false, false
             }, 100, 50);
             guiSave.SetActive(true);
             GameObject.Find("Molekül").GetComponent <EditMode>().editMode = false;
             GameObject.Find("UI0").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("UI1").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("UI2").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("UI3").transform.position = new Vector3(0, 0, 0);
             GameObject.Find("Molekül").SetActive(false);
         }
         else if (hit.collider.name == "PeriodensystemC" && (guiSave.activeInHierarchy == false))
         {
             senseGlove_Object.SendBuzzCmd(new bool[5] {
                 true, false, false, false, false
             }, 100, 50);
             SendMessage("kohlenstoffErstellen");
             //Methode von NeuesGameObjekt aufrufen: neuer Kohlenstoff
         }
         else if (hit.collider.name == "recycle bin" && (guiSave.activeInHierarchy == false))
         {
             senseGlove_Object.SendBuzzCmd(new bool[5] {
                 true, false, false, false, false
             }, 100, 50);
             this.GetComponent <GlobalCtrl>().recycle();
         }
         else if (hit.collider.name.StartsWith("atom") && (guiSave.activeInHierarchy == false))
         {
             senseGlove_Object.SendBuzzCmd(new bool[5] {
                 true, false, false, false, false
             }, 100, 50);
             //einzelnes Kohlenstoff Atom ausgewählt -- Bearbeitungsmodus öffnen
             if (GameObject.Find("Molekül").GetComponent <EditMode>().editMode == false)
             {
                 GameObject.Find("Molekül").GetComponent <EditMode>().editMode           = true;
                 GameObject.Find("Molekül").GetComponent <EditMode>().fixedAtom          = hit.collider.gameObject.GetComponent <Atom>();
                 hit.collider.gameObject.GetComponent <Renderer>().material.color        = new Color32(255, 0, 0, 255);
                 hit.collider.gameObject.GetComponent <SenseGlove_Grabable>().editMarker = true;
             }
             else if (GameObject.Find("Molekül").GetComponent <EditMode>().editMode == true && hit.collider.gameObject.GetComponent <Atom>()._id == GameObject.Find("Molekül").GetComponent <EditMode>().fixedAtom._id)
             {
                 hit.collider.gameObject.GetComponent <SenseGlove_Grabable>().editMarker = false;
                 GameObject.Find("Molekül").GetComponent <EditMode>().editMode           = false;
                 GameObject.Find("Molekül").GetComponent <EditMode>().fixedAtom          = null;
                 hit.collider.gameObject.GetComponent <Renderer>().material.color        = new Color32(0, 0, 0, 255);
             }
         }
     }
 }