Esempio n. 1
0
    // returns hows close the state is to the specified state index
    public bool Compare(int stateIndex, Transform head, Transform leftHand, Transform rightHand)
    {
        if (ignoreHead && ignoreLeftHand && ignoreRightHand)
        {
            return(false);
        }

        bool[] ignoreItems = new bool[3];
        ignoreItems[0] = ignoreHead;
        ignoreItems[1] = ignoreLeftHand;
        ignoreItems[2] = ignoreRightHand;

        VRBodyState otherState = new VRBodyState();

        MirrorVirtualComponents(head, leftHand, rightHand);
        otherState.Capture(recordedStates[stateIndex].stateTime, virtualHead, virtualLeftHand, virtualRightHand);

        if (!recordedStates[stateIndex].CompareVectors(otherState, ignoreItems))
        {
            return(false);
        }
        else
        {
            HighlightLeftHandProgress(stateIndex);
            HighlightRightHandProgress(stateIndex);
            progress = (float)stateIndex / (float)recordedStates.Count;
            action.InterpolateToProgress(progress);
        }

        // also compare angles

        return(true);
    }
Esempio n. 2
0
    public void CaptureState(Transform head, Transform leftHand, Transform rightHand)
    {
        VRBodyState newState = new VRBodyState();

        MirrorVirtualComponents(head, leftHand, rightHand);
        newState.Capture(recordingTime, virtualHead, virtualLeftHand, virtualRightHand);
        recordedStates.Add(newState);

        PlotPoints();
    }