UniVRM/Assets/UniGLTF/Runtime/UniHumanoid/HumanPoseClip.cs
ousttrue 29545202d3 UniHumanoid のフォルダ構成を整理し、不要になった asmdef を削除した。Resource/test_motion.txt の場所が変更になるのに注意。
* Assets/UniHumanoid/Scripts => Assets/UniGLTF/Runtime/Humanoid
* Assets/UniHumanoid/Editor => Assets/UniGLTF/Editor/Humanoid
* Assets/UniHumanoid/Editor/Tests => Assets/UniGLTF/Tests/Humanoid
* => docs/unihumanoid/index.md
2021-12-06 16:22:25 +09:00

34 lines
745 B
C#

using UnityEngine;
namespace UniHumanoid
{
public class HumanPoseClip : ScriptableObject
{
public const string TPoseResourcePath = "T-Pose.pose";
public Vector3 bodyPosition;
public Quaternion bodyRotation;
public float[] muscles;
public HumanPose GetPose()
{
return new HumanPose
{
bodyPosition = bodyPosition,
bodyRotation = bodyRotation,
muscles = muscles
};
}
public void ApplyPose(ref HumanPose pose)
{
bodyPosition = pose.bodyPosition;
bodyRotation = pose.bodyRotation;
muscles = (float[])pose.muscles.Clone();
}
}
}