// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) VRMADA, All rights reserved.
//
// --------------------------------------------------------------------------------------------------------------------
using System;
using UltimateXR.Animation.IK;
using UnityEngine;
namespace UltimateXR.Devices.Visualization
{
public partial class UxrControllerHand
{
#region Private Types & Data
///
/// Describes a finger used by a hand when interacting with a VR controller. It allows to graphically represent fingers
/// that interact with VR controllers by using Inverse Kinematics.
///
[Serializable]
private class FingerIK
{
#region Inspector Properties/Serialized Fields
[SerializeField] private UxrCcdIKSolver _fingerIKSolver;
[SerializeField] private float _fingerToGoalDuration = 0.1f;
#endregion
#region Public Types & Data
///
/// Gets the finger IK solver.
///
public UxrCcdIKSolver FingerIKSolver => _fingerIKSolver;
///
/// Gets the seconds it will take for a finger to reach the input element whenever it is pressed.
///
public float FingerToGoalDuration => _fingerToGoalDuration;
///
/// Gets or sets whether the component data has been initialized at runtime using
/// .
///
public bool Initialized { get; set; }
///
/// Gets or sets the effector initial local position. The effector is the part of the finger in the IK chain that will
/// try to reach the goal.
///
public Vector3 LocalEffectorInitialPos { get; set; }
///
/// Gets or sets the initial local position of the IK goal in a transition to a pressed state.
///
public Vector3 LocalGoalTransitionStartPos { get; set; }
///
/// Gets or sets the current goal transform. The goal is the transform that the finger will try to reach whenever the
/// input element is pressed.
///
public Transform CurrentFingerGoal { get; set; }
///
/// The or sets current timer in the transition to a pressed state, to smoothly transition the finger from its default
/// position to the pressed position.
///
public float TimerToGoal { get; set; }
///
/// Gets or sets whether the component is enabled. If it is disabled no IK will take place.
///
public bool ComponentEnabled { get; set; }
#endregion
}
#endregion
}
}