Ejemplo n.º 1
0
        private void Grab(GameObject currentGrabbingController, uint controllerIndex, GameObject target)
        {
            bodyPhysics.TogglePreventSnapToFloor(true);
            bodyPhysics.enableBodyCollisions = false;
            bodyPhysics.ToggleOnGround(false);

            isClimbing              = true;
            climbingObject          = target;
            grabbingController      = currentGrabbingController;
            startControllerPosition = GetPosition(grabbingController.transform);
            startPosition           = playArea.position;

            OnPlayerClimbStarted(SetPlayerClimbEvent(controllerIndex, climbingObject));
        }
Ejemplo n.º 2
0
        private void Grab(GameObject currentGrabbingController, uint controllerIndex, GameObject target)
        {
            bodyPhysics.TogglePreventSnapToFloor(true);
            bodyPhysics.enableBodyCollisions = false;
            bodyPhysics.ToggleOnGround(false);

            isClimbing         = true;
            climbingObject     = target;
            grabbingController = currentGrabbingController;
            startControllerScaledLocalPosition = GetScaledLocalPosition(grabbingController.transform);
            startGrabPointLocalPosition        = climbingObject.transform.InverseTransformPoint(grabbingController.transform.position);
            startPlayAreaWorldOffset           = playArea.transform.position - grabbingController.transform.position;
            climbingObjectLastRotation         = climbingObject.transform.rotation;
            useGrabbedObjectRotation           = climbingObject.GetComponent <VRTK_ClimbableGrabAttach>().useObjectRotation;

            OnPlayerClimbStarted(SetPlayerClimbEvent(controllerIndex, climbingObject));
        }
Ejemplo n.º 3
0
        private void Grab(GameObject currentGrabbingController, uint controllerIndex)
        {
            bodyPhysics.TogglePreventSnapToFloor(true);
            bodyPhysics.enableBodyCollisions = false;
            bodyPhysics.ToggleOnGround(false);

            prevVelocity       = playArea.GetComponent <Rigidbody>().velocity / 5;
            isClimbing         = true;
            grabbingController = currentGrabbingController;
            startControllerScaledLocalPosition = GetScaledLocalPosition(grabbingController.transform);
            startPlayAreaWorldOffset           = playArea.transform.position - grabbingController.transform.position;
            startGrabPointWorldPosition        = grabbingController.transform.position;
            startPlayerAreaPosition            = playArea.transform.position;


            OnPlayerClimbStarted(SetPlayerClimbEvent(controllerIndex));
        }