/*
* 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;
namespace Oculus.Interaction.Throw
{
///
/// Provides a unified interface for accessing pose and velocity data from input devices.
/// This interface is primarily used for implementing throwing mechanics and other physics-based
/// interactions that require accurate tracking of position, rotation, and velocity.
///
///
/// See and for common implementations.
///
public interface IPoseInputDevice
{
///
/// Indicates whether the current pose data from the input device is valid and can be used.
///
///
/// This should be checked before attempting to use pose data to ensure reliable tracking.
/// Invalid poses might occur during tracking loss or device initialization.
///
bool IsInputValid { get; }
///
/// Indicates whether the current pose tracking has high confidence.
///
///
/// Returns true if the system has high confidence in the current pose tracking accuracy.
/// For controllers, this checks if the pose is valid and controller are connected. For hands, this checks additional confidence metrics.
///
bool IsHighConfidence { get; }
///
/// Attempts to get the current root pose of the input device.
///
/// When successful, contains the current pose in world space coordinates.
///
/// Returns true if the pose was successfully retrieved, false if tracking is invalid or unavailable.
///
///
/// For hands, this returns the wrist root pose with palm offset applied. For controllers,
/// this returns the controller's tracked pose.
///
bool GetRootPose(out Pose pose);
///
/// Retrieves the current external velocities of the input device.
///
/// The current linear velocity in meters per second.
/// The current angular velocity in radians per second.
///
/// Returns true if velocities were successfully calculated, false otherwise.
///
///
/// For hands, this calculates velocities based on finger joint movement. For controllers,
/// this uses the device's built-in velocity tracking.
///
(Vector3, Vector3) GetExternalVelocities();
}
}