/// <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);
 }
Example #2
0
 /// <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());
 }
Example #3
0
 public Vector3 GetVelocity()
 {
     SetCaches();
     return(cachedVelocityEstimator.GetVelocityEstimate());
 }