// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) VRMADA, All rights reserved.
//
// --------------------------------------------------------------------------------------------------------------------
using System;
using UltimateXR.Attributes;
using UnityEngine;
namespace UltimateXR.Devices
{
public abstract partial class UxrHandTracking
{
#region Private Types & Data
///
/// Stores the relative rotation of a transform to a reference pose.
///
[Serializable]
private class BoneCalibration
{
#region Inspector Properties/Serialized Fields
[SerializeField] private Transform _transform;
[SerializeField] [ReadOnly] private float _x;
[SerializeField] [ReadOnly] private float _y;
[SerializeField] [ReadOnly] private float _z;
[SerializeField] [ReadOnly] private float _w;
#endregion
#region Public Types & Data
///
/// Gets the transform the calibration data is for.
///
public Transform Transform => _transform;
///
/// Gets or sets the relative rotation to the reference calibration pose.
///
public Quaternion Rotation
{
get => new Quaternion(_x, _y, _z, _w);
set
{
_x = value.x;
_y = value.y;
_z = value.z;
_w = value.w;
}
}
#endregion
#region Constructors & Finalizer
///
/// Constructor.
///
/// Transform
/// Rotation relative to the calibration pose
public BoneCalibration(Transform transform, Quaternion rotation)
{
_transform = transform;
Rotation = rotation;
}
#endregion
}
#endregion
}
}