/// <summary> /// The GetVelocityOnIndex method is used to determine the current velocity of the tracked object on the given index. /// </summary> /// <param name="index">The index of the tracked object to check for.</param> /// <returns>A Vector3 containing the current velocity of the tracked object.</returns> public override Vector3 GetVelocityOnIndex(uint index) { switch (index) { case 1: return(rightController.GetVelocity()); case 2: return(leftController.GetVelocity()); default: return(Vector3.zero); } }
/// <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) { uint index = VRTK_ControllerReference.GetRealIndex(controllerReference); switch (index) { case 1: return(rightController.GetVelocity()); case 2: return(leftController.GetVelocity()); default: return(Vector3.zero); } }