/* * 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 Oculus.Interaction.Input; using UnityEngine; namespace Oculus.Interaction { /// /// Provides a standardized interface for tracking and measuring finger-based interactions in the Interaction SDK. /// This interface enables different implementation methods for detecting palm grab, pinching, finger curl, and other hand poses. /// See and for example implementations. /// public interface IFingerAPI { /// /// Determines if a specific finger is currently in a grabbing state. /// /// The to check for grabbing state. /// True if the specified finger is grabbing, false otherwise. bool GetFingerIsGrabbing(HandFinger finger); /// /// Detects changes in a finger's grabbing state relative to a target state. /// /// The to check for state changes. /// The target grab state to compare against. /// True if the finger's grab state has changed to match the target state. bool GetFingerIsGrabbingChanged(HandFinger finger, bool targetPinchState); /// /// Retrieves a normalized score indicating how strongly a finger is grabbing. /// /// The to evaluate. /// A value between 0 and 1, where 0 indicates no grab and 1 indicates maximum grab strength. float GetFingerGrabScore(HandFinger finger); /// /// Gets the local space offset from the wrist position for grab calculations. /// /// The offset vector in local space coordinates. Vector3 GetWristOffsetLocal(); /// /// Updates the finger API with the latest hand tracking data. /// /// The tracking data to process. void Update(IHand hand); } }