Compare commits

..

2 Commits

Author SHA1 Message Date
70b1bf8932 Remove images 2024-09-17 19:07:49 +02:00
bfe58ed89f Update docs 2024-09-17 19:05:48 +02:00
4 changed files with 36 additions and 47 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 KiB

36
README Normal file
View File

@ -0,0 +1,36 @@
+-------------+
| Gravity |
+-------------+
C+OpenGL simulator of mass objects in
space - according to Newton.
FEATURES
[DONE] Object tracing
[DONE] Toggle object tracing
[DONE] Scaling up/down objects
[DONE] Locking camera view to an object
[TODO] File format for importing scenes
[TODO] Collision
INSTALL
Build automation system is cmake. Thus, one
can compile this project much like any other
cmake project.
mkdir build
cd build
cmake ..
make all
./gravity
LICENSE
Gravity is licensed under the GPL-3.0 license.
See the `LICENSE` file for more information.

View File

@ -1,42 +0,0 @@
<p align="center">
<img src=".imgs/icon.png" width="200"/>
</p>
# Gravity
---
Pet project simulator for interactions between matter built off of OpenGL and C.
Goals and features:
- [x] Law of gravitation
- [x] Object tracing
- [x] Toggle object tracing
- [ ] Grid
- [ ] Toggle Grid
- [x] Scaling up/down objects
- [x] Locking camera view to an object
- [ ] File format for importing scenes
- [ ] Collision
- [ ] Soft-bodies and structures
## Installation
Gravity uses CMake as its build automation system. To download and run gravity, please follow these steps:
- Clone the repository `git clone https://github.com/0xdeadbeer/gravity`
- Create a build directory `mkdir build`
- Go into the build directory `cd build`
- Generate build files `cmake ..`
- Compile project `make all`
- Run `./gravity`
- Enjoy
## Contributions
We highly encourage playing around with the software and contributing to the project.
Before opening a pull request, the contributor is expected to open an issue in which they thoroughly describe the issue (or feature) they're solving (or implementing).
## License
Gravity is licensed under the GPL-3.0 license. See the `LICENSE` file for more information.

View File

@ -445,7 +445,6 @@ int main(int argc, char **argv) {
struct object *a = create_object(100000000.0f, sphere_model);
struct object *b = create_object(100000.0f, sphere_model);
struct object *c = create_object(10000000.0f, sphere_model);
float distance = -500.0f;
vec4 a_pos = {0.0f, 0.0f, distance, 0.0f};
@ -458,15 +457,11 @@ int main(int argc, char **argv) {
// vec4 b_pos = {0.0f, -75.0f, -150.0f, 0.0f};
// glm_vec4_add(b->position, b_pos, b->position);
vec4 c_pos = {-100.0f, -400.0f, distance, 0.0f};
glm_vec4_add(c->position, c_pos, c->position);
float n = 0.05f;
vec3 b_boost = {-70*n, 0.0f, 0.0f};
glm_vec3_add(b->translation_force, b_boost , b->translation_force);
glm_vec3_add(c->translation_force, b_boost , c->translation_force);
// b->scale = 2.0f;
a->scale = 5.0f;