Commit 31204b40 authored by Stephen D's avatar Stephen D
Browse files

More sensible mass units, critical engine bug fix

parent 6358f9d0
......@@ -16,7 +16,7 @@ typedef struct RigidMass
} RigidMass_t;
double G = 6.67408E-11;
double G = 667.408;
//Calculates delta V on body, due to other.
void calcGravity(RigidMass_t *body, RigidMass_t other)
......@@ -96,7 +96,7 @@ int w = 1920;
int h = 1080;
int spawnSize = 500;
double maxComponentV = 10;
long m = 50000000000;
long m = 50;
int a = 100;
int iteration = 0;
char s[255]; //save filename
......@@ -118,7 +118,7 @@ void generateStars()
int randAddonY = h/2 - spawnSize/2;
RigidMass_t new;
new.mass = 50000000000;
new.mass = m;
new.dvx = 0;
new.dvy = 0;
new.tick_time = 0.05;
......@@ -276,7 +276,7 @@ int main(int argc, char **argv)
case 'h': h = atoi(optarg); break;
case 'p': spawnSize = atoi(optarg); break;
case 'v': maxComponentV = atof(optarg); break;
case 'm': m = atoi(optarg); break;
case 'm': m = atol(optarg); break;
case 'a': a = atoi(optarg); break;
case 's':
if(strlen(optarg) >= 255)
......@@ -321,7 +321,7 @@ int main(int argc, char **argv)
printf("\t W = %d, H = %d\r\n", w, h);
printf("\t spawn = %d\r\n", spawnSize);
printf("\t vComponentMax = %f\r\n", maxComponentV);
printf("\t m = %ld\r\n", m);
printf("\t m = %ldE9 kg\r\n", m);
printf("\t Autosave: %s-ID.sgs every %d iterations\r\n", s, a);
//allocate array
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment