Exemplo n.º 1
0
 public void render()
 {
     //transladarMunicion();
     //esfera.render();
     municion.render();
     //municion.BoundingSphere.render();
     //sphereB.setRenderColor(Color.Yellow);
     //sphereB.render();
     disminuirLifeTime(GuiController.Instance.ElapsedTime);
 }
Exemplo n.º 2
0
        public void render()
        {
            sphere.updateValues();
            sphere.render();

            if (this.mostrarBounding)
            {
                sphere.BoundingSphere.render();
                box.BoundingBox.render();
            }
        }
Exemplo n.º 3
0
        /// <param name="elapsedTime">Tiempo en segundos transcurridos desde el último frame</param>
        public override void render(float elapsedTime)
        {
            float moveForward = 0;
            float jump        = 0;



            //Device de DirectX para renderizar
            Device d3dDevice = GuiController.Instance.D3dDevice;


            //conviene deshabilitar ambas camaras para que no haya interferencia

            //Capturar Input teclado
            if (GuiController.Instance.D3dInput.keyDown(Microsoft.DirectX.DirectInput.Key.F))
            {
                moveForward = 100 * elapsedTime;
                //Tecla F apretada
            }

            if (GuiController.Instance.D3dInput.keyDown(Microsoft.DirectX.DirectInput.Key.Space))
            {
                jump = 100 * elapsedTime;
            }

            //Capturar Input Mouse
            if (GuiController.Instance.D3dInput.buttonPressed(TgcViewer.Utils.Input.TgcD3dInput.MouseButtons.BUTTON_LEFT))
            {
                //Boton izq apretado
            }

            Vector3 movementVector = new Vector3(
                FastMath.Sin(sphere.Rotation.Y) * moveForward,
                jump,
                FastMath.Cos(sphere.Rotation.Y) * moveForward
                );

            Vector3 realMovement = collisionManager.moveCharacter(sphere.BoundingSphere, movementVector, objetosColisionables);

            sphere.move(realMovement);

            sphere.updateValues();
            scene.renderAll();
            sphere.render();
            GuiController.Instance.RotCamera.CameraCenter = sphere.Position;

            //Mover Auto
            //mainCar.elapsedTime = elapsedTime;
            //mainCar.Mover();
            //

            //mainCar.meshAuto.render();
            //SetCarCamera();
        }
Exemplo n.º 4
0
        public void render()
        {
            bullet.render();

            sombra.Effect.SetValue("height", EjemploAlumno.Instance.heightOlas);
            sombra.Effect.SetValue("time", EjemploAlumno.Instance.time);
            //sombra.Effect.SetValue("radioBala", bullet.Radius);
            //sombra.Effect.SetValue("posBalaX", posicion.X);
            //sombra.Effect.SetValue("posBalaZ", posicion.Z);

            //salpicadura.Effect.SetValue("height", EjemploAlumno.Instance.heightOlas);
            salpicadura.Effect.SetValue("time", tiempo);//EjemploAlumno.Instance.time);
            //EjemploAlumno.Instance.cargarEfectoLuz(salpicadura.Effect);
            if (EjemploAlumno.Instance.lloviendo)
            {
                salpicadura.Effect.SetValue("fvLightPosition", TgcParserUtils.vector3ToFloat3Array(EjemploAlumno.Instance.lightMesh.Position));
                salpicadura.Effect.SetValue("fvEyePosition", TgcParserUtils.vector3ToFloat3Array(GuiController.Instance.ThirdPersonCamera.getPosition()));
                salpicadura.Effect.SetValue("k_la", 0.3f);
                salpicadura.Effect.SetValue("k_ld", 0.3f);
                salpicadura.Effect.SetValue("k_ls", 0f);
                salpicadura.Effect.SetValue("fSpecularPower", 250);
            }
            else
            {
                salpicadura.Effect.SetValue("fvLightPosition", TgcParserUtils.vector3ToFloat3Array(EjemploAlumno.Instance.lightMesh.Position));
                salpicadura.Effect.SetValue("fvEyePosition", TgcParserUtils.vector3ToFloat3Array(GuiController.Instance.ThirdPersonCamera.getPosition()));
                salpicadura.Effect.SetValue("k_la", 4f);
                salpicadura.Effect.SetValue("k_ld", 5f);
                salpicadura.Effect.SetValue("k_ls", 2.5f);
                salpicadura.Effect.SetValue("fSpecularPower", 60);
            }

            if (sombraActiva)
            {
                sombra.render();
            }
            else
            {
                salpicadura.render();
            }
        }
Exemplo n.º 5
0
        public override void Render()
        {
            PreRender();

            //Actualizar parametros de la caja
            updateSphere();

            UserVars.setValue("Vertices", sphere.VertexCount);
            UserVars.setValue("Triangulos", sphere.TriangleCount);
            //Renderizar caja
            sphere.render();

            //Mostrar Boundingsphere de la caja
            var boundingsphere = (bool)Modifiers["boundingsphere"];

            if (boundingsphere)
            {
                sphere.BoundingSphere.render();
            }

            PostRender();
        }
Exemplo n.º 6
0
        public override void render(float elapsedTime)
        {
            Device d3dDevice = GuiController.Instance.D3dDevice;

            //Actualizar parametros de la caja
            updateSphere();



            GuiController.Instance.UserVars.setValue("Vertices", sphere.VertexCount);
            GuiController.Instance.UserVars.setValue("Triangulos", sphere.TriangleCount);
            //Renderizar caja
            sphere.render();

            //Mostrar Boundingsphere de la caja
            bool boundingsphere = (bool)GuiController.Instance.Modifiers["boundingsphere"];

            if (boundingsphere)
            {
                sphere.BoundingSphere.render();
            }
        }
Exemplo n.º 7
0
        public void loadEnviroment(float elapsedTime)
        {
            totalTime += elapsedTime;
            if (oceanMovimientoLateral < 100000)
            {
                oceanPosition.Z = oceanPosition.Z + 0.001f;
                oceanMovimientoLateral++;
            }
            else if (oceanMovimientoLateral < 200000 && oceanMovimientoLateral >= 100000)
            {
                oceanPosition.Z = oceanPosition.Z - 0.001f;
                oceanMovimientoLateral++;
            }
            else if (oceanMovimientoLateral == 200000)
            {
                oceanMovimientoLateral = 0;
            }


            ocean.Position = oceanPosition;
            ocean.setVerticesY(TgcEditableLand.SELECTION_CENTER, (float)Math.Cos(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_INTERIOR_RING, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_EXTERIOR_RING, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_TOP_SIDE, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_LEFT_SIDE, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_RIGHT_SIDE, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_BOTTOM_SIDE, (float)Math.Sin(totalTime));
            ocean.updateValues();
            sun.rotateX(0.00001f);
            skyBox.Radius   = (int)GuiController.Instance.Modifiers["skyRadius"];
            skyBox.Position = (Vector3)GuiController.Instance.Modifiers["skyPosition"];
            //oceanPosition = (Vector3)GuiController.Instance.Modifiers["oceanPosition"];

            ocean.render();
            sun.render();
            skyBox.render();
        }
Exemplo n.º 8
0
 public override void render()
 {
     mesh.render();
 }