You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
492 B

  1. #ifndef ENGINE_H
  2. #define ENGINE_H
  3. typedef struct RigidMass
  4. {
  5. long mass;
  6. double vx, vy;
  7. double x, y;
  8. double dvx, dvy;
  9. double tick_time;
  10. } RigidMass_t;
  11. struct node_t
  12. {
  13. long mass;
  14. int n; //num masses
  15. double xmin;
  16. double xmax;
  17. double ymin;
  18. double ymax;
  19. double CoM_x;
  20. double CoM_y;
  21. //0 - top left
  22. //1 - top right
  23. //2 - bottom left
  24. //3 - bottom right
  25. struct node_t *nodes[4];
  26. };
  27. extern const double G;
  28. void barnesIterate(RigidMass_t *masses, int n, int w, int h);
  29. #endif