void steer(float de, float disFob, float df, int t) { if (de == 0f) { transform.rotation = Quaternion.Euler(new Vector3(0, 0, direction * 180)); return; } ; float st; if (t == 0) { st = Steerage.clarify(de); } else { // Debug.Log ("DeviationFob: " + x + " Distance: " + disFob); st = SteerageFob.clarify(de, disFob, df); // st = Steerage.clarify(x); // Debug.Log ("Steerage Fob: " + st); } // Debug.Log ("T : " + t); // Debug.Log ("Steerage: " + st); float d = -(st - 0.5f) * 180f; // Debug.Log ("Degree: " + d); transform.rotation = Quaternion.Euler(new Vector3(0, 0, direction * 180 + d)); // Debug.Log ("Rotation: "+ transform.rotation.z); Vector2 v = getDirectVelocity(st); // if(t == 1) // Debug.Log ("Vector Velocity: " + v + " Speed: " + this.speed); rb.velocity = v * this.speed * 3f; // Debug.Log ("Velocity: "+rb.velocity); }
public static float getRule05() { float uDe = Deviation.uFL(de); float uDi = Distance.uN(di); float uDf = Deviation.uFR(df); float a = Mathf.Min(uDe, Mathf.Min(uDi, uDf)); float b = uDe * uDi * uDf; burning += b; return(b * Steerage.hardRight(a)); }