feature: 模型绑定四肢和身体
This commit is contained in:
@@ -10,6 +10,8 @@ namespace Models
|
||||
protected readonly GameObject Start;
|
||||
protected readonly GameObject End;
|
||||
private readonly GameObject _bond;
|
||||
|
||||
public Quaternion Rotation => _bond.transform.rotation;
|
||||
|
||||
public Bond(GameObject start,GameObject end,float scale)
|
||||
{
|
||||
|
@@ -40,7 +40,7 @@ namespace Models
|
||||
/// </summary>
|
||||
public float Z { get; }
|
||||
|
||||
public Vector3 Vector3 => new Vector3(X, Y, Z);
|
||||
public Vector3 Position => new Vector3(-X, -Y, -0.2f * Z);
|
||||
|
||||
/// <summary>
|
||||
/// 该坐标点估计的可见性
|
||||
|
@@ -4,11 +4,11 @@ namespace Models
|
||||
{
|
||||
public struct RotationNode
|
||||
{
|
||||
public HumanBodyBones UnityName;
|
||||
public readonly HumanBodyBones UnityName;
|
||||
public Quaternion PreviousRotation;
|
||||
public Quaternion Rotation;
|
||||
|
||||
public Quaternion CalculateRotate => PreviousRotation * Quaternion.Inverse(PreviousRotation);
|
||||
public Quaternion CalculateRotate => PreviousRotation * Quaternion.Inverse(Rotation);
|
||||
|
||||
public RotationNode(HumanBodyBones humanBodyBone, Quaternion previousRotation, Quaternion rotation)
|
||||
{
|
||||
@@ -22,7 +22,7 @@ namespace Models
|
||||
UnityName = node.UnityName;
|
||||
PreviousRotation = node.Rotation;
|
||||
|
||||
var forward = new Vector3(end.X - begin.X, end.Y - begin.Y, end.Z - begin.Z);
|
||||
var forward = end.Position - begin.Position;
|
||||
Rotation = Quaternion.LookRotation(forward);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user