feature: 添加z轴压缩处理类 修复了身体前倾的问题
This commit is contained in:
20
Assets/Utils/PoseTransformHandlers/ZAxisHandler.cs
Normal file
20
Assets/Utils/PoseTransformHandlers/ZAxisHandler.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Models;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Utils.PoseTransformHandlers
|
||||
{
|
||||
public class ZAxisHandler : IPoseTransformHandler
|
||||
{
|
||||
private Vector3 _result;
|
||||
|
||||
public void ReceivePoseLandmark(PoseLandmark landmark)
|
||||
{
|
||||
_result = new Vector3(landmark.X, landmark.Y, landmark.Z * 0.5f);
|
||||
}
|
||||
|
||||
public Vector3 GetResultPosition()
|
||||
{
|
||||
return _result;
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Utils/PoseTransformHandlers/ZAxisHandler.cs.meta
Normal file
3
Assets/Utils/PoseTransformHandlers/ZAxisHandler.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12369669a7fc44eaae881f89678649b1
|
||||
timeCreated: 1678024599
|
Reference in New Issue
Block a user