Code/HumanoidRetargeter/Core/Skeleton/BoneDefinition.cs

A small readonly record struct that defines a single bone for building a skeleton. It stores a unique Name, an optional ParentName (null for root bones), and a RestLocal transform in centimeters.

Native Interop
#nullable enable annotations

using System;
using System.Collections.Generic;
using HumanoidRetargeter.Core.Maths;

namespace HumanoidRetargeter.Core.Skeleton;

/// <summary>
/// Input definition for a single bone, used to build a <see cref="Skeleton"/>.
/// Order does not matter; construction topologically sorts parents before children.
/// </summary>
/// <param name="Name">Unique bone name.</param>
/// <param name="ParentName">Parent bone name, or null for a root bone (multiple roots allowed).</param>
/// <param name="RestLocal">Rest (bind) transform relative to the parent bone, centimeters.</param>
[Alias( "HumanoidRetargeter.Skeleton.BoneDefinition" )]
public readonly record struct BoneDefinition(string Name, string? ParentName, XForm RestLocal);