private bool verificarPosAdelante(Moto moto, float ElepsedTime) { double distAhora = this.distancia(moto.getPosicion()); this.avanzar(ElepsedTime); double distDespues = this.distancia(moto.getPosicion()); this.retroceder(ElepsedTime); return(distDespues < distAhora ? true : false); }
public void seguirObjetivo(Moto moto, float ElepsedTime, List <CustomVertex.PositionColored[]> obstaculos, List <TgcMesh> cajas) { if (!moto.getPosicion().Equals(new Vector3(0, 0, 0))) { //posicion inicial this.acelerar(ElepsedTime); comprobarColisionSiguienteUpdate(obstaculos, cajas); if (verificarGiro(ElepsedTime)) { if (verificarGiroDerecha(moto, ElepsedTime)) { this.girarDerecha(true); } if (verificarGiroIzquierda(moto, ElepsedTime)) { this.girarIzquierda(true); } } } }