Ejemplo n.º 1
0
    public void Release(FenrirVRController controller)
    {
        //Make sure the hand is still the parent.
        //Could have been transferred to anothr hand.
        if (transform.parent == controller.gameObject.transform)
        {
            //Return previous kinematic state
            rigidBody.isKinematic = originalKinematicState;

            //Set object's parent to its original parent
            if (originalParent != controller.gameObject.transform)
            {
                //Ensure original parent recorded wasn't somehow the controller (failsafe)
                transform.SetParent(originalParent);
            }
            else
            {
                transform.SetParent(null);
            }

            //Throw object
            rigidBody.velocity        = controller.device.velocity;
            rigidBody.angularVelocity = controller.device.angularVelocity;
        }
    }
Ejemplo n.º 2
0
    public void Pickup(FenrirVRController controller)
    {
        //Make object kinematic
        //(Not effected by physics, but still able to effect other objects with physics)
        Debug.Log(gameObject.name);
        //rigidBody = GetComponent<Rigidbody>();
        rigidBody.isKinematic = true;

        //Parent object to hand
        transform.SetParent(controller.gameObject.transform);
    }
Ejemplo n.º 3
0
 public virtual void RayExit(FenrirVRController controller = null)
 {
 }
Ejemplo n.º 4
0
 public virtual void RayStay(RaycastHit hit, FenrirVRController controller = null)
 {
 }
Ejemplo n.º 5
0
 public virtual void ButtonPressUp(EVRButtonId button, FenrirVRController controller)
 {
 }
Ejemplo n.º 6
0
 public virtual void TriggerExit(FenrirVRController controller)
 {
 }
Ejemplo n.º 7
0
 public void Start()
 {
     cont     = GetComponent <FenrirVRController>();
     cursorRT = cursorImage.GetComponent <RectTransform>();
 }