Health/Assets/Scripts/PoseCheck/HeadTurnRight.cs

26 lines
697 B
C#

using OpenCVForUnity.CoreModule;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HeadTurnRight : PoseBase
{
public override bool CheckPose(List<Point> points)
{
if (!CheckPoint(points, "Nose"))
return false;
//右转头检测
if (!CheckPoint(points, "REar") && CheckPoint(points, "LEar"))
return true;
if (Math.Abs(points[YogaConfig.BODY_PARTS["REar"]].x - points[YogaConfig.BODY_PARTS["Nose"]].x) > Math.Abs(points[YogaConfig.BODY_PARTS["LEar"]].x - points[YogaConfig.BODY_PARTS["Nose"]].x))
{
return true;
}
return false;
}
}