orbit: fix planets not orbiting

This commit is contained in:
Paul Mathieu 2022-11-20 17:53:12 -08:00
parent f86697aad8
commit 9bb162e7d5
2 changed files with 3 additions and 2 deletions

View File

@ -363,7 +363,8 @@ async function main() {
// [ ] landing // [ ] landing
// [ ] huge planets // [ ] huge planets
// [x] lighting // [x] lighting
// [ ] better lighting // [x] better lighting
// [ ] betterer lighting
// [x] optimize geometry generation // [x] optimize geometry generation
const modelPromise = loadObjModel('spaceship.obj'); const modelPromise = loadObjModel('spaceship.obj');

View File

@ -181,7 +181,7 @@ export function getCartesianState(orbit: Orbit, mu: number, time: number) {
// Newton's method // Newton's method
var E2 = 0; var E2 = 0;
var E = orbit.lastE || M; var E = M;
let iterations = 0; let iterations = 0;
// a clever guess? https://link.springer.com/article/10.1023/A:1008200607490 // a clever guess? https://link.springer.com/article/10.1023/A:1008200607490
// doesn't work at all. // doesn't work at all.