feature: 船新的基于过程的动作绑定
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Models
|
||||
{
|
||||
@@ -39,6 +40,8 @@ namespace Models
|
||||
/// </summary>
|
||||
public float Z { get; }
|
||||
|
||||
public Vector3 Vector3 => new Vector3(X, Y, Z);
|
||||
|
||||
/// <summary>
|
||||
/// 该坐标点估计的可见性
|
||||
/// [0,1]
|
||||
|
29
Assets/Models/RotationNode.cs
Normal file
29
Assets/Models/RotationNode.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Models
|
||||
{
|
||||
public struct RotationNode
|
||||
{
|
||||
public HumanBodyBones UnityName;
|
||||
public Quaternion PreviousRotation;
|
||||
public Quaternion Rotation;
|
||||
|
||||
public Quaternion CalculateRotate => PreviousRotation * Quaternion.Inverse(PreviousRotation);
|
||||
|
||||
public RotationNode(HumanBodyBones humanBodyBone, Quaternion previousRotation, Quaternion rotation)
|
||||
{
|
||||
UnityName = humanBodyBone;
|
||||
PreviousRotation = previousRotation;
|
||||
Rotation = rotation;
|
||||
}
|
||||
|
||||
public RotationNode(RotationNode node, PoseLandmark begin, PoseLandmark end)
|
||||
{
|
||||
UnityName = node.UnityName;
|
||||
PreviousRotation = node.Rotation;
|
||||
|
||||
var forward = new Vector3(end.X - begin.X, end.Y - begin.Y, end.Z - begin.Z);
|
||||
Rotation = Quaternion.LookRotation(forward);
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Models/RotationNode.cs.meta
Normal file
3
Assets/Models/RotationNode.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87e238cb51f34339a39945af13f43248
|
||||
timeCreated: 1680090845
|
Reference in New Issue
Block a user