Exemplo n.º 1
0
        private void UpdateWorld()
        {
            long  curTicks  = DateTime.Now.Ticks;
            float timeDelta = ( float )(curTicks - prevTicks) / TimeSpan.TicksPerSecond;

            input.Poll();

            if (inputGrabbed)
            {
                camera.Update(timeDelta);
                Cursor.Position = grabbedAtPosition;
            }

            prevTicks = curTicks;
        }
Exemplo n.º 2
0
        public void Update(float delta)
        {
            time += delta;

            input.Poll();
            fpsCamera.Update(delta);

            if (!visibilityFixed)
            {
                numVisibleFaces = map.FindVisibleFaces(fpsCamera, visibleFaces);
                QSortFaces(0, numVisibleFaces - 1);
            }

            if (shaderEnabled && effect != null)
            {
                effect.SetValue(EffectHandle.FromString("Time"), time);
            }
        }