mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 14:04:29 -05:00
add ControlRigRetarget impl InitialRotationRigGetter.cs impl NormalizedRotationRigGetter.cs mv Assets/Vrm10/Runtime/ControlRig/Vrm10ControlBone.cs => Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10ControlBone.cs mv Assets/VRM10/Runtime/ControlRig/InitialRotations/ControlRigGenerationOption.cs => Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRigGenerationOption.cs rename Vrm10BoneInitialRotation => BoneInitialRotation remove Vrm0XCompatibleRig.cs
16 lines
477 B
C#
16 lines
477 B
C#
namespace UniVRM10
|
|
{
|
|
public static class ControlRigRetarget
|
|
{
|
|
public static void Retarget(IControlRigGetter getter, IControlRigSetter setter)
|
|
{
|
|
foreach (var (head, parent) in setter.EnumerateBones())
|
|
{
|
|
var q = getter.GetNormalizedLocalRotation(head, parent);
|
|
setter.SetNormalizedLocalRotation(head, q);
|
|
}
|
|
setter.SetRootPosition(getter.GetRootPosition());
|
|
}
|
|
}
|
|
}
|