Beispiel #1
0
  void
  SetVMax(fixed _v_max, bool update = true)
  {
    Vmax = _v_max;

    if (update) {
      UpdateSMax();
      UpdateSMin();
    }
  }
Beispiel #2
0
void
GlidePolar::Update()
{
  assert(positive(bugs));

  if (!ideal_polar.IsValid()) {
    Vmin = Vmax = fixed(0);
    return;
  }

  const fixed loading_factor = sqrt(GetTotalMass() / reference_mass);
  const fixed inv_bugs = fixed(1)/bugs;

  polar.a = inv_bugs * ideal_polar.a / loading_factor;
  polar.b = inv_bugs * ideal_polar.b;
  polar.c = inv_bugs * ideal_polar.c * loading_factor;

  assert(polar.IsValid());

  UpdateSMax();
  UpdateSMin();
}