示例#1
0
        /// <summary>
        /// The GetAngularVelocityOnIndex method is used to determine the current angular 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 angular velocity of the tracked object.</returns>
        public override Vector3 GetAngularVelocityOnIndex(uint index)
        {
            switch (index)
            {
            case 1:
                return(rightController.GetAngularVelocity());

            case 2:
                return(leftController.GetAngularVelocity());

            default:
                return(Vector3.zero);
            }
        }
示例#2
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)
        {
            uint index = VRTK_ControllerReference.GetRealIndex(controllerReference);

            switch (index)
            {
            case 1:
                return(rightController.GetAngularVelocity());

            case 2:
                return(leftController.GetAngularVelocity());

            default:
                return(Vector3.zero);
            }
        }