/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * Licensed under the Oculus SDK License Agreement (the "License"); * you may not use the Oculus SDK except in compliance with the License, * which is provided at the time of installation or download, or which * otherwise accompanies this software in either electronic or hard copy form. * * You may obtain a copy of the License at * * https://developer.oculus.com/licenses/oculussdk/ * * Unless required by applicable law or agreed to in writing, the Oculus SDK * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using UnityEngine; using System; namespace Oculus.Interaction.Input { public interface IHand { Handedness Handedness { get; } bool IsConnected { get; } /// /// The hand is connected and tracked, and the root pose's tracking data is marked as /// high confidence. /// If this is true, then it implies that IsConnected and IsRootPoseValid are also true, /// so they don't need to be checked in addition to this. /// bool IsHighConfidence { get; } bool IsDominantHand { get; } float Scale { get; } bool GetFingerIsPinching(HandFinger finger); bool GetIndexFingerIsPinching(); /// /// Will return true if a pointer pose is available, that can be retrieved via /// /// bool IsPointerPoseValid { get; } /// /// Attempts to calculate the pose that can be used as a root for raycasting, in world space /// Returns false if there is no valid tracking data. /// bool GetPointerPose(out Pose pose); /// /// Attempts to calculate the pose of the requested hand joint, in world space. /// Returns false if the skeleton is not yet initialized, or there is no valid /// tracking data. /// bool GetJointPose(HandJointId handJointId, out Pose pose); /// /// Attempts to calculate the pose of the requested hand joint, in local space. /// Returns false if the skeleton is not yet initialized, or there is no valid /// tracking data. /// bool GetJointPoseLocal(HandJointId handJointId, out Pose pose); /// /// Returns an array containing the local pose of each joint. The poses /// do not have the root pose applied, nor the hand scale. It is in the same coordinate /// system as the hand skeleton. /// /// The array with the local joint poses. /// It will be empty if no poses where found /// /// True if the poses collection was correctly populated. False otherwise. /// bool GetJointPosesLocal(out ReadOnlyHandJointPoses localJointPoses); /// /// Attempts to calculate the pose of the requested hand joint relative to the wrist. /// Returns false if the skeleton is not yet initialized, or there is no valid /// tracking data. /// bool GetJointPoseFromWrist(HandJointId handJointId, out Pose pose); /// /// Returns an array containing the pose of each joint relative to the wrist. The poses /// do not have the root pose applied, nor the hand scale. It is in the same coordinate /// system as the hand skeleton. /// /// The array with the joint poses from the wrist. /// It will be empty if no poses where found /// /// True if the poses collection was correctly populated. False otherwise. /// bool GetJointPosesFromWrist(out ReadOnlyHandJointPoses jointPosesFromWrist); /// /// Obtains palm pose in local space. /// /// The pose to populate /// /// True if pose was obtained. /// bool GetPalmPoseLocal(out Pose pose); bool GetFingerIsHighConfidence(HandFinger finger); float GetFingerPinchStrength(HandFinger finger); /// /// True if the hand is currently tracked, thus tracking poses are available for the hand /// root and finger joints. /// This property does not indicate pointing pose validity, which has its own property: /// . /// bool IsTrackedDataValid { get; } /// /// Gets the root pose of the wrist, in world space. /// Will return true if a pose was available; false otherwise. /// Confidence level of the pose is exposed via . /// bool GetRootPose(out Pose pose); /// /// Incremented every time the source tracking or state data changes. /// int CurrentDataVersion { get; } event Action WhenHandUpdated; } }