public void render() { //transladarMunicion(); //esfera.render(); municion.render(); //municion.BoundingSphere.render(); //sphereB.setRenderColor(Color.Yellow); //sphereB.render(); disminuirLifeTime(GuiController.Instance.ElapsedTime); }
public void render() { sphere.updateValues(); sphere.render(); if (this.mostrarBounding) { sphere.BoundingSphere.render(); box.BoundingBox.render(); } }
/// <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(); }
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(); } }
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(); }
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(); } }
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(); }
public override void render() { mesh.render(); }