明示的なインターフェイスの実装

This commit is contained in:
ousttrue
2023-02-27 19:18:51 +09:00
parent 18660498a5
commit 4f6ff8f798
3 changed files with 9 additions and 9 deletions

View File

@@ -69,13 +69,13 @@ namespace UniVRM10
}
}
public void SetRawHipsPosition(Vector3 position)
void INormalizedPoseApplicable.SetRawHipsPosition(Vector3 position)
{
var world = _controlRigRoot.TransformPoint(position);
_hipBone.ControlBone.position = world;
}
public void SetNormalizedLocalRotation(HumanBodyBones bone, Quaternion normalizedLocalRotation)
void INormalizedPoseApplicable.SetNormalizedLocalRotation(HumanBodyBones bone, Quaternion normalizedLocalRotation)
{
if (_bones.TryGetValue(bone, out var t))
{
@@ -83,7 +83,7 @@ namespace UniVRM10
}
}
public EuclideanTransform? GetWorldTransform(HumanBodyBones bone)
EuclideanTransform? ITPoseProvider.GetWorldTransform(HumanBodyBones bone)
{
if (_bones.TryGetValue(bone, out var t))
{

View File

@@ -40,7 +40,7 @@ namespace UniVRM10
}
}
public Quaternion GetNormalizedLocalRotation(HumanBodyBones bone, HumanBodyBones parentBone)
Quaternion INormalizedPoseProvider.GetNormalizedLocalRotation(HumanBodyBones bone, HumanBodyBones parentBone)
{
if (m_animator.GetBoneTransform(bone) is Transform t)
{
@@ -54,13 +54,13 @@ namespace UniVRM10
}
}
public Vector3 GetRawHipsPosition()
Vector3 INormalizedPoseProvider.GetRawHipsPosition()
{
// TODO: from model root ?
return m_animator.GetBoneTransform(HumanBodyBones.Hips).localPosition;
}
public EuclideanTransform? GetWorldTransform(HumanBodyBones bone)
EuclideanTransform? ITPoseProvider.GetWorldTransform(HumanBodyBones bone)
{
if (m_posMap.TryGetValue(bone, out var t))
{

View File

@@ -32,7 +32,7 @@ namespace UniVRM10
}
}
public Quaternion GetNormalizedLocalRotation(HumanBodyBones bone, HumanBodyBones parentBone)
Quaternion INormalizedPoseProvider.GetNormalizedLocalRotation(HumanBodyBones bone, HumanBodyBones parentBone)
{
if (m_bones.TryGetValue(bone, out var c))
{
@@ -45,7 +45,7 @@ namespace UniVRM10
}
}
public Vector3 GetRawHipsPosition()
Vector3 INormalizedPoseProvider.GetRawHipsPosition()
{
if (m_hips.parent == m_root)
{
@@ -57,7 +57,7 @@ namespace UniVRM10
}
}
public EuclideanTransform? GetWorldTransform(HumanBodyBones bone)
EuclideanTransform? ITPoseProvider.GetWorldTransform(HumanBodyBones bone)
{
throw new System.NotImplementedException();
}