/// <summary> /// The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference. /// </summary> /// <param name="controllerReference">The reference to the tracked object to check for.</param> /// <returns>A Vector3 containing the current velocity of the tracked object.</returns> public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference) { if (VRTK_ControllerReference.IsValid(controllerReference)) { if (controllerReference.hand == ControllerHand.Left && cachedLeftVelocityEstimator != null) { return(cachedLeftVelocityEstimator.GetVelocityEstimate()); } else if (controllerReference.hand == ControllerHand.Right && cachedRightVelocityEstimator != null) { return(cachedRightVelocityEstimator.GetVelocityEstimate()); } } return(Vector3.zero); }
/// <summary> /// The GetHeadsetVelocity method is used to determine the current velocity of the headset. /// </summary> /// <returns>A Vector3 containing the current velocity of the headset.</returns> public override Vector3 GetHeadsetVelocity() { SetHeadsetCaches(); return(cachedHeadsetVelocityEstimator.GetVelocityEstimate()); }
public Vector3 GetVelocity() { SetCaches(); return(cachedVelocityEstimator.GetVelocityEstimate()); }