Beispiel #1
0
        private IServerDeltaGestureState GetGestureDelta(IGestureState state)
        {
            if (!DeltaGestureStates.ContainsKey(state.ProviderName))
            {
                DeltaGestureStates[state.ProviderName] = new Dictionary <string, IServerDeltaGestureState>();
            }

            if (!DeltaGestureStates[state.ProviderName].ContainsKey(state.InputName))
            {
                var deltaState = new DeltaGestureState
                {
                    InputName        = state.InputName,
                    ProviderName     = state.ProviderName,
                    Acceleration     = 0,
                    Velocity         = 0,
                    TimeDelta        = 1,
                    DetectedLastTick = false,
                    DetectedThisTick = false,
                    Intensity        = 0,
                    LastIntensity    = 0
                };

                DeltaGestureStates[state.ProviderName][state.InputName] = deltaState;
                AllDeltas.Add(deltaState);
                AllMeasuredDeltas.Add(deltaState);
                return(deltaState);
            }

            return(DeltaGestureStates[state.ProviderName][state.InputName]);
        }
Beispiel #2
0
 public void ApplyNewState(IGestureState newState)
 {
     DetectedThisTick       = true; //If we are applying, then it was detected this time.
     _accumulatedIntensity += newState.Intensity;
 }