Commit 4d42622e authored by Stephen D's avatar Stephen D
Browse files

Options work for collision catalyst

parent 48336bb5
......@@ -4,6 +4,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
//types that we need
//TODO: put these in their own file
......@@ -149,6 +150,7 @@ int main(int argc, char **argv)
break;
case 'v':
vel = atoi(optarg);
break;
default:
prnHelp(argv[0]);
}
......@@ -166,17 +168,25 @@ int main(int argc, char **argv)
printf("Loading %s...\r\n", argv[argc - 2]);
loadGalaxy(argv[argc - 2], &conf2, &stars2);
//THESE SHOULD BE CALCULATED!
//Hardcoded only temporarily!
/*point_t pos1; pos1.x = -500; pos1.y = -500;
point_t pos2; pos2.x = 1500; pos2.y = -500;
point_t vel1; vel1.x = 10; vel1.y = 10;
point_t vel2; vel2.x = -10; vel2.y = 10;*/
point_t pos1; pos1.x = 250; pos1.y = 250;
point_t pos2; pos2.x = 750; pos2.y = 750;
int d = 1000; //distance from galaxy to collision point
int w = conf1.imgW;
int h = conf1.imgH;
double angleRad = 3.1415926535 * (0.5 - angle / 360);
int dx = d * cos(angleRad);
int dy = d * sin(angleRad);
point_t pos1;
pos1.x = w/2 + dx;
pos1.y = h/2 - dy;
point_t pos2;
pos2.x = w/2 - dx;
pos2.y = h/2 - dy;
point_t vel1;
vel1.x = -vel * cos(angleRad);
vel1.y = vel * sin(angleRad);
point_t vel2;
vel2.x = vel * cos(angleRad);
vel2.y = vel * sin(angleRad);
//Galaxy 1
point_t c1 = calculateCoM(stars1, conf1.nStars);
......
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