Resolved that annoying gravity bug and added trajectories, a grid, keyboard navigation and logarithimic scale

This commit is contained in:
2024-07-12 16:07:49 +02:00
parent a93080b371
commit 2afc695aba
10 changed files with 284 additions and 50 deletions
+18 -1
View File
@@ -18,6 +18,8 @@ public:
void render(const Simulator& simulator);
bool shouldClose();
void swapBuffers();
void processInput();
void cursorPosCallback(double xpos, double ypos);
private:
GLFWwindow* window;
@@ -28,6 +30,21 @@ private:
GLuint sphereVAO, sphereVBO, sphereEBO;
int sphereVertexCount, sphereIndexCount;
void drawGrid();
void drawGrid(const Simulator& simulator);
float calculateGravityFieldStrength(const glm::vec3& point, const std::vector<CelestialBody>& bodies);
void drawGravityField(const Simulator& simulator);
void drawTrajectories(const std::vector<CelestialBody>& bodies);
glm::vec3 cameraPos;
glm::vec3 cameraFront;
glm::vec3 cameraUp;
float cameraSpeed;
float mouseSensitivity;
float yaw;
float pitch;
bool firstMouse;
double lastX, lastY;
void updateCameraVectors();
};
#endif //GRAVITY_RENDERER_H