コード例 #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
ファイル: SDK_UnityHeadset.cs プロジェクト: emmacp/test2
 /// <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());
 }