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 64c6f16 commit 7d475d7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CShark/Animales/Animal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public virtual void Update(GameModel game) {
}

public virtual void Render() {
Mesh.Transform = UsarTransformacionFisica
Mesh.Transform = UsarTransformacionFisica
? new TGCMatrix(Body.InterpolationWorldTransform)
: ArmarTransformacion();
Mesh.Render();
Expand Down
2 changes: 1 addition & 1 deletion CShark/Animales/Comportamiento/Perseguidor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void AvanzarHaciaPlayer(float elapsedTime, Animal animal)
{
var direccionDespl = Objetivo.Posicion - animal.Posicion;
var desplazam = direccionDespl * VelocidadMovimiento * 0.1f;
if (direccionDespl.Length() < 100f)
if (direccionDespl.Length() > 100f)
{
animal.Posicion += desplazam;
}
Expand Down
2 changes: 1 addition & 1 deletion CShark/Animales/Enemigos/Tiburon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Tiburon(TGCVector3 posicionInicial) : base("Tiburon", posicionInicial) {
TiempoInvencibilidad = 0f;
BarraVida = new HealthBar(Vida);
var builder = new RigidBodyBuilder("Tiburon");
Body = builder.ConDamping(1f).ConRotacion(Rotacion).ConPosicion(Posicion)
Body = builder.ConDamping(1f).ConRotacion(Rotacion).ConPosicion(posicionInicial)
.ConRebote(10f).ConRozamiento(1f).ConMasa(0f).Build();
Mapa.Instancia.AgregarBody(Body);
Mesh.BoundingBox.setRenderColor(Color.Red);
Expand Down
2 changes: 1 addition & 1 deletion CShark/Managers/FaunaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void Initialize() {
var posicion = SpawnPezRandom();
Spawnear(tipo, posicion);
}*/
Spawnear("Tiburon", SpawnPezRandom());
Spawnear("Tiburon", new TGCVector3(85195,12304,-62625));
}

private TgcBoundingAxisAlignBox AreaSpawneable1;
Expand Down
2 changes: 1 addition & 1 deletion CShark/Model/Configuracion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static Configuracion Instancia {
private Configuracion() {
VelocidadMovimiento = new Variable<float>("Velocidad de movimiento", 500f);
VelocidadRotacion = new Variable<float>("Velocidad de rotación", 0.1f);
ModoDios = new Variable<bool>("Modo Dios", true);
ModoDios = new Variable<bool>("Modo Dios", false);
Niebla = new Variable<bool>("Niebla", false);
PostProcesadoCasco = new Variable<bool>("Post Procesado (Casco)", false);
MotionBlur = new Variable<bool>("Motion Blur", false);
Expand Down
21 changes: 11 additions & 10 deletions CShark/Model/GameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class GameModel : TgcExample {
public GameManager GameManager;
private PantallaMuerte PantallaMuerte;
private Mapa Mapa => Mapa.Instancia;
//private Casco Casco;
// private bool RenderCasco = false;
private Casco Casco;
private bool RenderCasco = false;

public GameModel(string mediaDir, string shadersDir) : base(mediaDir, shadersDir)
{
Expand All @@ -43,7 +43,7 @@ public override void Init() {
PantallaMuerte = new PantallaMuerte();
GameManager = new GameManager();
D3DDevice.Instance.Device.Transform.Projection = TGCMatrix.PerspectiveFovLH(45, D3DDevice.Instance.AspectRatio, D3DDevice.Instance.ZNearPlaneDistance, 450000f);
//Casco = new Casco();
Casco = new Casco();
Start();
}

Expand Down Expand Up @@ -86,7 +86,7 @@ public override void Update() {
public override void Render() {


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

Expand All @@ -96,9 +96,10 @@ public override void Render() {
Frustum.updateMesh(Player.Posicion, Camara.LookAt, 16.0f / 9, 0, 1000, 70);
//UpdateFrustum();

/*if (RenderCasco) {
if (RenderCasco)
{
Casco.RenderBeforeScene();
}*/
}

GameManager.Render(this);
Mapa.Render(this);
Expand All @@ -108,19 +109,19 @@ public override void Render() {
else
PantallaMuerte.Render();

/*if (RenderCasco)
if (RenderCasco)
{
Casco.RenderAfterScene();
}*/
}

PostRender();

}

public override void Dispose() {
GameManager.Dispose();
/*if (Casco != null)
Casco.Dispose();*/
if (Casco != null)
Casco.Dispose();
}

public void CambiarMenu(TipoMenu tipoMenu) {
Expand Down

0 comments on commit 7d475d7

Please sign in to comment.