Esempio n. 1
0
 // Start is called before the first frame update
 void Start()
 {
     Target = new BodyAngles();
     Target.FrontalAngles.AddAngle(BoneType.LeftClavicule, BoneType.RightClavicule, 145.0f);
     turnFoot  = false; // false == direita; true == esquerda
     leftFoot  = new Vector3();
     rightFoot = new Vector3();
     ball      = GameObject.Find("Sphere");
     text      = GameObject.Find("Canvas/Text");
     text.SetActive(false);
     begin   = true;
     andando = false;
 }
Esempio n. 2
0
    private void ChangePose()
    {
        switch (targetPose)
        {
        case DefaultPose.Upright:
            targetBodyAngles = BodyAngles.Upright();
            break;

        case DefaultPose.TPose:
            targetBodyAngles = BodyAngles.TPose();
            break;

        case DefaultPose.MakeContact:
            targetBodyAngles = BodyAngles.MakeContact();
            break;
        }
    }
Esempio n. 3
0
    public void ReceiveData(BodyJoints[] data)
    {
        foreach (var body in data)
        {
            if (body.status != Status.Tracking)
            {
                continue;
            }

            var currentBodyAngles = new BodyAngles(body);
            var errors            = MovementAnalyzer.CompareBodyAngles(currentBodyAngles, targetBodyAngles, angleTolerance);

            foreach (var error in errors)
            {
                //   Debug.Log(error.plane + " " + error.boneTypes[0] + "/" + error.boneTypes[1]);
            }
        }
    }
Esempio n. 4
0
        public static BodyAngles TPose()
        {
            var pose = new BodyAngles();

            pose.FrontalAngles.AddAngle(BoneType.UpperNeck, BoneType.LowerNeck, 0);

            pose.FrontalAngles.AddAngle(BoneType.LowerNeck, BoneType.UpperBody, 0);
            pose.FrontalAngles.AddAngle(BoneType.LowerNeck, BoneType.LeftClavicule, 90);
            pose.FrontalAngles.AddAngle(BoneType.LowerNeck, BoneType.RightClavicule, 90);

            pose.FrontalAngles.AddAngle(BoneType.LeftClavicule, BoneType.RightClavicule, 0);
            pose.FrontalAngles.AddAngle(BoneType.LeftClavicule, BoneType.LeftArm, 0);
            pose.FrontalAngles.AddAngle(BoneType.LeftClavicule, BoneType.UpperBody, 90);

            pose.FrontalAngles.AddAngle(BoneType.LeftArm, BoneType.LeftForearm, 0);
            pose.FrontalAngles.AddAngle(BoneType.LeftForearm, BoneType.LeftWrist, 0);

            pose.FrontalAngles.AddAngle(BoneType.RightClavicule, BoneType.RightArm, 0);
            pose.FrontalAngles.AddAngle(BoneType.RightClavicule, BoneType.UpperBody, 90);

            pose.FrontalAngles.AddAngle(BoneType.RightArm, BoneType.RightForearm, 0);
            pose.FrontalAngles.AddAngle(BoneType.RightForearm, BoneType.RightWrist, 0);

            pose.FrontalAngles.AddAngle(BoneType.UpperBody, BoneType.LowerBody, 0);
            pose.FrontalAngles.AddAngle(BoneType.LowerBody, BoneType.LeftHipbone, 90);
            pose.FrontalAngles.AddAngle(BoneType.LowerBody, BoneType.RightHipbone, 90);

            //pose.FrontalAngles.AddAngle(BoneType.LeftHipbone, BoneType.LeftThigh, 90);
            //pose.FrontalAngles.AddAngle(BoneType.LeftHipbone, BoneType.RightHipbone, 0);

            //pose.FrontalAngles.AddAngle(BoneType.LeftThigh, BoneType.LeftLeg, 0);

            //pose.FrontalAngles.AddAngle(BoneType.LeftLeg, BoneType.LeftAnkle, 0);

            //pose.FrontalAngles.AddAngle(BoneType.RightHipbone, BoneType.RightThigh, 90);

            //pose.FrontalAngles.AddAngle(BoneType.RightThigh, BoneType.RightLeg, 0);

            //pose.FrontalAngles.AddAngle(BoneType.RightLeg, BoneType.RightAnkle, 90);

            return(pose);
        }