Skip to content

Commit

Permalink
Entrega 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Salomé Tredici committed May 29, 2019
1 parent df43d7c commit 64c6f16
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
8 changes: 6 additions & 2 deletions CShark/Animales/Comportamiento/Perseguidor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ public void Update(float elapsedTime, Animal animal)

public void Render()
{

}

private void AvanzarHaciaPlayer(float elapsedTime, Animal animal)
{
var direccionDespl = Objetivo.Posicion - animal.Posicion;
var desplazam = direccionDespl * VelocidadMovimiento * 0.1f;
animal.Posicion += desplazam;
if (direccionDespl.Length() < 100f)
{
animal.Posicion += desplazam;
}

}

}
Expand Down
10 changes: 7 additions & 3 deletions CShark/Model/GameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public override void Init() {
Cursor.Hide();
PantallaMuerte = new PantallaMuerte();
GameManager = new GameManager();
D3DDevice.Instance.Device.Transform.Projection = TGCMatrix.PerspectiveFovLH(45, D3DDevice.Instance.AspectRatio, D3DDevice.Instance.ZNearPlaneDistance, 450000f);
//Casco = new Casco();
Start();
}
Expand Down Expand Up @@ -84,13 +85,16 @@ public override void Update() {

public override void Render() {


// RenderCasco = Configuracion.Instancia.PostProcesadoCasco.Valor && !Player.onPause;
BackgroundColor = Efectos.Instancia.colorNiebla;
ClearTextures();

PreRender();
Frustum.updateVolume(TGCMatrix.FromMatrix(D3DDevice.Instance.Device.Transform.View), TGCMatrix.FromMatrix(D3DDevice.Instance.Device.Transform.Projection));
Frustum.updateMesh(Player.Posicion, Camara.LookAt, 16.0f / 9, 0, 10000, 70);
UpdateFrustum();
var FrustumMatrix = TGCMatrix.PerspectiveFovLH(45,D3DDevice.Instance.AspectRatio,D3DDevice.Instance.ZNearPlaneDistance,450f);
Frustum.updateVolume(TGCMatrix.FromMatrix(D3DDevice.Instance.Device.Transform.View), TGCMatrix.FromMatrix(FrustumMatrix));
Frustum.updateMesh(Player.Posicion, Camara.LookAt, 16.0f / 9, 0, 1000, 70);
//UpdateFrustum();

/*if (RenderCasco) {
Casco.RenderBeforeScene();
Expand Down
1 change: 1 addition & 0 deletions CShark/Optimizaciones/Octree.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CShark.Objetos;
using System.Collections.Generic;
using System.Linq;
using TGC.Core.BoundingVolumes;
using TGC.Core.Collision;
using TGC.Core.Geometry;
Expand Down
1 change: 0 additions & 1 deletion CShark/UI/Inventario/MenuInventario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public override void Update(GameModel juego)
base.Update(juego);
Botones.ForEach(b => b.Update(juego, this));
Titulo.Text = Seleccionado.ToString();
InfoItem = CantDisponibleDisplay(player);
}

public new void Dispose()
Expand Down
9 changes: 5 additions & 4 deletions CShark/Utils/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ public static class Constants
"Impulsar hacia la derecha - D",
"Impulsar hacia adelante - W",
"Impulsar hacia atrás - S",
"Impulsar hacia arriba/Saltar (Fuera del agua) - Space",
"Impulsar hacia abajo - X",
"Frenar impulso - F",
"Impulsar hacia arriba/Saltar - Space",
//"Impulsar hacia abajo - X",
//"Frenar impulso - F",
"Disparar - Click derecho",
"Abrir/Cerrar menús - Esc",
"Abrir menú de crafteo - E (Sólo en radio del bote)",
"Abrir menú de crafteo - E (Sólo en mesa de crafteo)",
"Recoger item - E",
"Abrir inventario - I"
};
}
Expand Down

0 comments on commit 64c6f16

Please sign in to comment.