Пример #1
0
 // Update the state of the orbiter when its position along the ellipse changes
 // Note: Make sure the ellipse is up to date before updating the orbit state
 private void Update(float orbiterAngle, Orbiter orbiter, OrbitalEllipse ellipse)
 {
     this.orbiter  = orbiter;
     this.ellipse  = ellipse;
     this.normal   = CalcNormal(orbiterAngle);
     this.tangent  = CalcTangent(normal);
     this.position = ellipse.GetPosition(orbiterAngle, orbiter.orbitAround.position);
     this.velocity = CalcVelocity(orbiter.orbitSpeed * orbiter.GravityConstant(), position, orbiter.orbitAround.position);
 }