예제 #1
0
 void MedicalController_OnLoopUpdate(Engine.Platform.Clock time)
 {
     virtualTextureManager.update();
 }
예제 #2
0
 void controller_OnUpdate(Engine.Platform.Clock obj)
 {
     virtualTextureManager.update();
 }
예제 #3
0
 /// <summary>
 /// The update function, do not call this outside EventManager.
 /// </summary>
 /// <param name="eventLayer"></param>
 /// <param name="allowProcessing"></param>
 protected internal abstract void update(EventLayer eventLayer, bool allowProcessing, Clock clock);
예제 #4
0
        protected internal override void update(EventLayer eventLayer, bool allowProcessing, Clock clock)
        {
            var touches = eventLayer.EventManager.Touches;
            var fingers = touches.Fingers;

            if (fingers.Count == 2)
            {
                Finger  finger1    = fingers[0];
                Finger  finger2    = fingers[1];
                Vector2 finger1Vec = new Vector2(finger1.NrmlDeltaX, finger1.NrmlDeltaY);
                Vector2 finger2Vec = new Vector2(finger2.NrmlDeltaX, finger2.NrmlDeltaY);
                float   finger1Len = finger1Vec.length2();
                float   finger2Len = finger2Vec.length2();
                if (finger1Len > 0 || finger2Len > 0)
                {
                    if (finger1Len > 0 && finger2Len > 0)
                    {
                        float cosTheta = finger1Vec.dot(ref finger2Vec) / (finger1Vec.length() * finger2Vec.length());
                        if (cosTheta < -0.5f && Zoom != null)
                        {
                            computeZoom(eventLayer, ref didGesture, finger1, finger2, ref finger1Vec, ref finger2Vec);
                        }
                    }
                    else if (finger1Len == 0 && finger2Len > 0)
                    {
                        computeZoom(eventLayer, ref didGesture, finger1, finger2, ref finger1Vec, ref finger2Vec);
                    }
                    else if (finger2Len == 0 && finger1Len > 0)
                    {
                        computeZoom(eventLayer, ref didGesture, finger1, finger2, ref finger1Vec, ref finger2Vec);
                    }
                }
            }

            //Momentum
            if (!didGesture)
            {
                if (momentum > 0.0f)
                {
                    zoomDelta = momentum * momentumDirection;

                    if (!momentumStarted)
                    {
                        momentumStarted = true;
                        if (MomentumStarted != null)
                        {
                            MomentumStarted.Invoke(eventLayer, this);
                        }
                    }

                    momentum -= deceleration * clock.DeltaSeconds;
                    if (momentum < 0.0f)
                    {
                        momentum = 0.0f;
                    }
                    if (Zoom != null)
                    {
                        Zoom.Invoke(eventLayer, this);
                    }
                }
                else if (momentumStarted)
                {
                    zoomDelta = 0.0f;

                    momentumStarted = false;
                    gestureStarted  = false;
                    if (MomentumEnded != null)
                    {
                        MomentumEnded.Invoke(eventLayer, this);
                    }
                }
            }
            didGesture = false;
        }
 public void startBackgroundWork(Clock clock)
 {
     this.currentClock = clock;
     workerThreadWait.Set();
 }
예제 #6
0
 /// <summary>
 /// Update function.
 /// </summary>
 /// <param name="clock">The clock.</param>
 public void sendUpdate(Clock clock)
 {
     eventManager.updateEvents(clock);
 }