Ejemplo n.º 1
0
    private void InitPrimaryGrab(VRTK_InteractableObject currentGrabbedObject)
    {
        currentGrabbedObject.SaveCurrentState();
        currentGrabbedObject.Grabbed(gameObject);
        currentGrabbedObject.ZeroVelocity();
        currentGrabbedObject.ToggleHighlight(false);
        currentGrabbedObject.ToggleKinematic(false);

        //Pause collisions (if allowed on object) for a moment whilst sorting out position to prevent clipping issues
        currentGrabbedObject.PauseCollisions();

        if (currentGrabbedObject.grabAttachMechanic == VRTK_InteractableObject.GrabAttachType.Child_Of_Controller)
        {
            currentGrabbedObject.ToggleKinematic(true);
        }
    }
Ejemplo n.º 2
0
        protected virtual void InitPrimaryUse(VRTK_InteractableObject currentUsedObject)
        {
            if (!currentUsedObject.IsValidInteractableController(gameObject, currentUsedObject.allowedGrabControllers))
            {
                usedObject = null;
                if (interactTongTouch != null && currentUsedObject.IsGrabbed(gameObject))
                {
                    interactTongTouch.ForceStopTouching();
                }
                return;
            }

            influencingUsedObject = false;
            currentUsedObject.SaveCurrentState();
            currentUsedObject.Grabbed(this);
            currentUsedObject.ZeroVelocity();
            currentUsedObject.isKinematic = false;
        }
Ejemplo n.º 3
0
 protected override void InitSecondaryGrab(VRTK_InteractableObject currentUsedObject)
 {
     influencingGrabbedObject = true;
     currentUsedObject.Grabbed(this);
 }