Exemplo n.º 1
0
        //---------------------------------------------------------------------------------------------------------------------------------
        // Touch Methods

        /// <summary> Get the index  </summary>
        /// <param name="grabScript"></param>
        /// <returns></returns>
        protected int GetTouchIndex(SG_HapticGlove grabScript)
        {
            //for (int i = 0; i < this.touchedScripts.Count; i++)
            //{
            //    if (GameObject.ReferenceEquals(this.touchedScripts[i].gameObject, grabScript.gameObject))
            //        return i;
            //}
            return(-1);
        }
Exemplo n.º 2
0
 /// <summary> Get a list of all Haptic Glove Hardware within this detection area. </summary>
 /// <returns></returns>
 public SG_HapticGlove[] GlovesInside()
 {
     SG_HapticGlove[] res = new SG_HapticGlove[this.detectedHands.Count];
     for (int i = 0; i < this.detectedHands.Count; i++)
     {
         res[i] = this.detectedHands[i].Glove;
     }
     return(res);
 }
Exemplo n.º 3
0
 /// <summary> Checks for scripts that might be connected to this GameObject. Used in editor and during startup. </summary>
 public override void CheckForScripts()
 {
     base.CheckForScripts();
     if (this.gloveHardware == null)
     {
         this.gloveHardware = this.Hardware;
     }
     SG_Util.CheckForHandInfo(this.transform, ref this.handModel);
 }
Exemplo n.º 4
0
        //-------------------------------------------------------------------------------------------------------------------------------------------
        // Functions

        /// <summary> Setup the SG_BasicFeedback script components  </summary>
        public virtual void SetupSelf()
        {
            //Debug.Log(this.name + "Calculated Offsets!");
            SG_Util.TryAddRB(this.gameObject, false, true);
            cooldownTimer = 0;
            SetTrackingTarget(this.trackingTarget, true); //updates offsets on start
            this.lastPosition = this.transform.position;

            if (this.linkedGlove == null && this.feedbackScript != null && this.feedbackScript.TrackedHand != null)
            {
                this.linkedGlove = this.feedbackScript.TrackedHand.gloveHardware;
            }
        }