Exemplo n.º 1
0
        public override void Render()
        {
            PreRender();

            //Ver si cambio el nivel elegido
            var selectedFileName = openFileModifier.Value;

            if (selectedFileName != currentLevelFile)
            {
                currentLevelFile = selectedFileName;
                loadLevel(currentLevelFile);
            }

            //Actualizar valores de Modifiers
            bspMap.CollisionManager.Camera.MovementSpeed = speedModifier.Value;
            bspMap.CollisionManager.Gravity   = gravityModifier.Value;
            bspMap.CollisionManager.JumpSpeed = jumpSpeedModifier.Value;
            bspMap.CollisionManager.NoClip    = noClipModifier.Value;

            //Actualizar estado de colsiones y renderizar con Frustum Culling utilizando matriz PVS
            var currentPosition = bspMap.CollisionManager.update(ElapsedTime, Input);

            bspMap.render(currentPosition, Frustum, ElapsedTime);

            PostRender();
        }
Exemplo n.º 2
0
        public override void Render(float elapsedTime)
        {
            base.Render(elapsedTime);

            //Ver si cambio el nivel elegido
            var selectedFileName = (string)this.Modifiers["Level"];

            if (selectedFileName != currentLevelFile)
            {
                currentLevelFile = selectedFileName;
                loadLevel(currentLevelFile);
            }

            //Actualizar valores de Modifiers
            bspMap.CollisionManager.Camera.MovementSpeed = (float)this.Modifiers.getValue("Speed");
            bspMap.CollisionManager.Gravity   = (float)this.Modifiers.getValue("Gravity");
            bspMap.CollisionManager.JumpSpeed = (float)this.Modifiers.getValue("JumpSpeed");
            bspMap.CollisionManager.NoClip    = (bool)this.Modifiers.getValue("NoClip");

            //Actualizar estado de colsiones y renderizar con Frustum Culling utilizando matriz PVS
            var currentPosition = bspMap.CollisionManager.update(elapsedTime);

            bspMap.render(currentPosition, elapsedTime);
        }