예제 #1
0
 /// <summary>
 /// The GetAngularVelocity method is used to determine the current angular 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 angular velocity of the tracked object.</returns>
 public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)
 {
     if (VRTK_ControllerReference.IsValid(controllerReference))
     {
         if (controllerReference.hand == ControllerHand.Left && cachedLeftVelocityEstimator != null)
         {
             return(cachedLeftVelocityEstimator.GetAngularVelocityEstimate());
         }
         else if (controllerReference.hand == ControllerHand.Right && cachedRightVelocityEstimator != null)
         {
             return(cachedRightVelocityEstimator.GetAngularVelocityEstimate());
         }
     }
     return(Vector3.zero);
 }
예제 #2
0
 /// <summary>
 /// The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
 /// </summary>
 /// <returns>A Vector3 containing the current angular velocity of the headset.</returns>
 public override Vector3 GetHeadsetAngularVelocity()
 {
     SetHeadsetCaches();
     return(cachedHeadsetVelocityEstimator.GetAngularVelocityEstimate());
 }
예제 #3
0
 public Vector3 GetAngularVelocity()
 {
     SetCaches();
     return(cachedVelocityEstimator.GetAngularVelocityEstimate());
 }