// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) VRMADA, All rights reserved.
//
// --------------------------------------------------------------------------------------------------------------------
using UnityEngine;
namespace UltimateXR.Animation.IK
{
public sealed partial class UxrBodyIK
{
#region Private Types & Data
///
/// Independent bones are bones that are driven externally and not using IK, such as the hands (wrist bones), which are
/// driven by the tracked input controllers. They need to be kept track of when parent bones are modified by Inverse
/// Kinematics to make sure that they are kept in the same place afterwards. Otherwise due to parenting the position
/// they should have would change.
///
private class IndependentBoneInfo
{
#region Public Types & Data
///
/// Gets the bone transform.
///
public Transform Transform { get; }
///
/// Gets or sets the correct current position.
///
public Vector3 Position { get; set; }
///
/// Gets or sets the correct current position.
///
public Quaternion Rotation { get; set; }
#endregion
#region Constructors & Finalizer
///
/// Constructor.
///
/// Bone transform
public IndependentBoneInfo(Transform transform)
{
Transform = transform;
Position = transform.position;
Rotation = transform.rotation;
}
#endregion
}
#endregion
}
}