public void Interpolate() { if (!hasBeenRipped) { if (!CheckIfSnapOverThreshold() && _customThrowable.getCurrentHandType() == SteamVR_Input_Sources.LeftHand) { head.transform.position = Vector3.Lerp(leftHand.transform.position, bodySnapPoint.transform.position, 0.5f); //head.transform.rotation = //UnityEngine.Quaternion.Lerp(leftHand.transform.rotation, bodySnapPoint.transform.rotation, 0.5f); vibration.vibrationOfLeftController(0, 1, 1000, 200); } else if (!CheckIfSnapOverThreshold() && _customThrowable.getCurrentHandType() == SteamVR_Input_Sources.RightHand) { head.transform.position = Vector3.Lerp(rightHand.transform.position, bodySnapPoint.transform.position, 0.5f); //head.transform.rotation = //UnityEngine.Quaternion.Lerp(leftHand.transform.rotation, bodySnapPoint.transform.rotation, 0.5f); vibration.vibrationOfRightController(0, 1, 1000, 200); } else if (CheckIfSnapOverThreshold()) { ResetHeadToOriginalPosition(); } } }
public void rowControl() { Vector3 differenceLeft = leftHand.transform.position - previousPosLeft; Vector3 differenceRight = rightHand.transform.position - previousPosRight; if (firstActivate) { differenceLeft = new Vector3(0, 0, 0); differenceRight = new Vector3(0, 0, 0); firstActivate = false; } if (differenceLeft.x > 0 && differenceRight.x > 0 && !battle) { transform.position += new Vector3(((differenceLeft.x + differenceRight.x) / 2) * speedModifier, 0, 0); //velocity * Time.deltaTime; vibration.vibrationOfRightController(0, 0.1f, 1000, 200); vibration.vibrationOfLeftController(0, 0.1f, 1000, 200); _audio.Play("RowSound"); } previousPosLeft = leftHand.transform.position; previousPosRight = rightHand.transform.position; }