예제 #1
0
    bool calcCor(int state)
    {
        mCorXml  = CorXml.getInstance();
        position = mCorXml.getPos(mNum);

        Vector3 dis = position[state] - distance;
        // Debug.Log(mNum);
        float value = dis.sqrMagnitude;

        //기울기 분석 추가

        //가우시안 필터 적용 추가

        mText.text    = value.ToString();
        timeText.text = netTime.ToString();

        if (value < th1)
        {
            mat.color = Color.green;
            errorTime = Time.time;
            return(true);
        }
        else if (value < th2)
        {
            mat.color = Color.yellow;
            netTime   = netTime + ((Time.time - errorTime) / 2);
            errorTime = Time.time;
            return(false);
        }
        mat.color = Color.red;
        netTime   = netTime + (Time.time - errorTime);
        errorTime = Time.time;
        return(false);
    }
예제 #2
0
 public static CorXml getInstance()
 {
     if (corXml == null)
     {
         corXml = new CorXml();
     }
     return(corXml);
 }
예제 #3
0
    void Start()
    {
        mDataSet = new List <string>();
        corXml   = CorXml.getInstance();

        //corXml.loadFile("test.txt");
        errorTimes = new float[5];

        head.init((int)body.head);
        lh.init((int)body.leftHand);
        rh.init((int)body.rightHand);
        lf.init((int)body.leftFoot);
        rf.init((int)body.rightFoot);
    }