{"id":16323662,"url":"https://github.com/im-rises/physicalengine","last_synced_at":"2025-03-22T21:32:50.258Z","repository":{"id":60169307,"uuid":"535653421","full_name":"Im-Rises/PhysicalEngine","owner":"Im-Rises","description":"Physical Engine written in C++ with GLFW, Glad, OpenGL 3 and Dear ImGui","archived":false,"fork":false,"pushed_at":"2024-09-03T21:49:22.000Z","size":5802,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T22:55:17.553Z","etag":null,"topics":["3d-graphics","cmake","cpp","game","game-development","game-engine","glad","glfw","glm","gui","imgui","opengl","particles-simulation"],"latest_commit_sha":null,"homepage":"https://im-rises.github.io/physical-engine-webgl/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Im-Rises.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-09-12T12:21:51.000Z","updated_at":"2024-09-30T15:59:06.000Z","dependencies_parsed_at":"2023-11-14T03:43:16.296Z","dependency_job_id":null,"html_url":"https://github.com/Im-Rises/PhysicalEngine","commit_stats":{"total_commits":376,"total_committers":4,"mean_commits":94.0,"dds":"0.19414893617021278","last_synced_commit":"847a7a36237ea735c4a37a51efe9120549e66728"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FPhysicalEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FPhysicalEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FPhysicalEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Im-Rises%2FPhysicalEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Im-Rises","download_url":"https://codeload.github.com/Im-Rises/PhysicalEngine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221840129,"owners_count":16889737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-graphics","cmake","cpp","game","game-development","game-engine","glad","glfw","glm","gui","imgui","opengl","particles-simulation"],"created_at":"2024-10-10T22:55:22.226Z","updated_at":"2024-10-28T14:27:07.930Z","avatar_url":"https://github.com/Im-Rises.png","language":"C++","readme":"# PhysicalEngine\n\n\u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://user-images.githubusercontent.com/59691442/183268126-b3d19e66-8f2d-463a-805e-ae6ef7cc6c01.png\" alt=\"cmakeLogo\" style=\"height:60px;\"/\u003e\n      \u003cimg src=\"https://img.shields.io/badge/C%2B%2B-00599C?style=for-the-badge\u0026logo=c%2B%2B\u0026logoColor=white\" alt=\"cppLogo\" style=\"height:60px;\"/\u003e\n      \u003cimg src=\"https://user-images.githubusercontent.com/59691442/190315010-0a84e171-a2bc-42a4-91c8-bb850960209c.png\" alt=\"openglLogo\" style=\"height:60px;\"/\u003e\n      \u003cimg src=\"https://user-images.githubusercontent.com/59691442/190315147-ec9dc33f-0090-4f0d-98ab-514eb1463e01.png\" alt=\"glfwLogo\" style=\"height:60px;\"/\u003e\n\u003c/p\u003e\n\n## Description\n\nThis is a simple physics engine written in C++ using Glad, GLFW, OpenGl3 and Dear ImGui.\n\nIt is implemented using Fixed Framerate and Component Oriented Programming.\n\n## 🚀🚀 [You can test it online here](https://im-rises.github.io/physical-engine-webgl/) 🚀🚀\n\nThe source code of the WebGL can be found at the following link:  \n\u003chttps://github.com/Im-Rises/physical-engine-webgl\u003e\n\n\u003e **Note**  \n\u003e The project is made as a educational project to learn more about physics and game engine development.\n\n## Features\n\n### Physics features\n\n- [x] Basic object types (Sphere, Cube, Cylinder, Plane)\n- [x] Particle and Rigid Body Physics\n- [x] Collision Detection\n- [x] Forces (Gravity, Drag, Spring, Buoyancy)\n- [x] Torque forces (Angular Drag, Angular Spring)\n- [x] Different types of constraints\n\n### User Interface features\n\n- [x] Camera Controls\n- [x] GameObjects Inspector\n- [x] Scene Hierarchy\n\n### Other features\n\n- [x] Basic ECS (Entity Component System)\n- [x] Component Oriented Programming\n- [x] Fixed Framerate\n- [x] GameObject's speed Graph visualization\n\n## Images\n\n![RigidBodyImage](https://user-images.githubusercontent.com/59691442/204342827-5407dc9f-c05e-4a26-b513-b37ce5ab7d14.png)\n\n![screenshot2](https://user-images.githubusercontent.com/59691442/206077820-3edaff06-8d5e-4187-a575-251b4acec8d3.png)\n\n\u003c!--\n![preview_screenshot](https://user-images.githubusercontent.com/59691442/196303021-781cf236-4bab-4523-9f08-2a85c7dd491c.png)\n![image1](https://user-images.githubusercontent.com/59691442/192190493-f1191715-268e-43e4-8f27-5ed0c2823dfa.png)\n![image2](https://user-images.githubusercontent.com/59691442/192190499-457463ae-7a34-432a-bb0b-063771021275.png)\n--\u003e\n\n\u003c!--\n## Report\n\nYou can find a journal log [here](report/development_log_phase1_REBOUL_CLAVEL_MOREL.pdf).  \nIt is also located in the `report` folder.\n--\u003e\n\n## Quickstart\n\nTo download the app, you can click one of the icons below (depending on your operating system). You can also click the\nrelease section of the GitHub page.\n\nDepending on you `operating system` you will need to install some libs, they are installed differently depending on your\nsystem, please follow one of the section below `Windows` or `Linux` or `MacOs`.\n\n\u003e **Warning**\n\u003e Be sure to put the `imgui.ini` file in the same folder as the executable.\n\u003e You can find it in the `root` of the project. If you don't do this, the UI will not be displayed correctly.\n\n### Windows\n\n\u003ca href=\"https://github.com/Im-Rises/PhysicalEngine/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor Windows users you don't need to install the libs. You can just download the app and run it.\n\n```bash\n.\\PhysicalEngine.exe\n```\n\n\u003e **Warning**  \n\u003e The project is set up to be built using CMake and vc2019 for Windows. If you want to modify the\n\u003e compiler for vc2022 or other you will need to change the CMakeLists.txt .lib linking file accordingly to your vc20**\n\u003e version.\n\n### Linux\n\n\u003ca href=\"https://github.com/Im-Rises/PhysicalEngine/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor Linux users, you need to install the GLFW lib, to do so type one of the following commands:\n\n```bash\nsudo apt-get install libglfw3\n```\n\nor if you're a developer and want to compile the app, please install this version of GLFW:\n\n```bash\nsudo apt-get install libglfw3-dev\n```\n\nThen you can start by double-clicking the executable of typing the following command next to it:\n\n```bash\n./PhysicalEngine\n```\n\n### MacOs\n\n\u003ca href=\"https://github.com/Im-Rises/PhysicalEngine/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=white\" alt=\"cmakeLogo\" style=\"height:40px;\"/\u003e\u003c/a\u003e\n\nFor macOS users you will need to install Brew, please follow the instruction in the link below:  \n\u003chttps://brew.sh\u003e\n\nOnce it is installed, you can type the following command to install GLFW.\n\n```bash\nbrew install glfw\n```\n\nThen you can start by double-clicking the executable of typing the following command next to it:\n\n```bash\n./PhysicalEngine\n```\n\n## Controls\n\n### Game controls\n\nTo modify the speed value, you can use the ImGui window named `Speed handler`.\n\n| Action                 | Key |\n|------------------------|-----|\n| Add speed to the left  | ←   |\n| Add speed to the right | →   |\n| Add speed forwardly    | ↑   |\n| Add speed rearward     | ↓   |\n\n### User controls\n\n| Action                        | Key                                   |\n|-------------------------------|---------------------------------------|\n| Toggle fullscreen             | F11                                   |\n| Camera zoom                   | Mouse wheel                           |\n| Translate camera to the left  | Right Mouse Button + Mouse ← movement |\n| Translate camera to the right | Right Mouse Button + Mouse → movement |\n| Translate camera upwards      | Right Mouse Button + Mouse ↑ movement |\n| Translate camera downwards    | Right Mouse Button + Mouse ↓ movement |\n| Exit app                      | ESC                                   |\n\n## Project Architecture\n\n~~~\nPhysicalEngine\n├── .github\n|  ├── labels.yml\n|  ├── release.yml\n│  ├── workflows\n│  │   |── cmake.yml\n│  │   |── codeql.yml\n│  │   |── cpp-cmake-publish.yml\n│  │   |── cpp-linter.yml\n│  │   |── dependency-review.yml\n│  │   |── flawfinder.yml\n│  │   |── greetings.yml\n│  │   |── label.yml\n│  │   |── msvc.yml\n│  │   |── stale.yml\n├── dependencies\n|  ├── glad\n|  ├── glfw\n|  ├── glm\n|  ├── imgui\n|  ├── stb\n├── PhysicalEngine\n|  ├── Contact (Particles)\n│  │   |── *\n|  ├── Force\n│  │   |── *\n|  ├── Octree\n│  │   |── *\n|  ├── RigidbodyContact\n│  │   |── *\n|  ├── Scene\n│  │   |── *\n|  ├── Shader\n│  │   |── *\n|  ├── Utility\n│  │   |── *\n|  ├── CMakeLists.txt\n|  ├── Game.cpp\n|  ├── Game.h\n|  ├── InputManager.cpp\n|  ├── InputManager.h\n|  ├── main.cpp\n|  ├── PhysicalEngineLauncher.cpp\n|  ├── PhysicalEngineLauncher.h\n├── test\n|  ├── TestParticle\n│  │   |── *\n|  ├── CMakeLists.txt\n|  ├── matrix33Test.cpp\n|  ├── matrix34Test.cpp\n|  ├── quaternionTest.cpp\n|  ├── vector3dTest.cpp\n├── .clang-format\n├── .editorconfig\n├── .gitattributes\n├── .gitignore\n├── CMakelists.txt\n├── CMakePresets.json\n├── CMakeSettings.json\n├── imgui.ini\n├── README.md\n~~~\n\n## Dependencies\n\n- C++ 14\n- CMake\n- C++ compiler (MSVC, Mingw, ...)\n- Glad\n- GLFW (3.3.8)\n- OpenGl (3.3)\n- Dear ImGui (1.88)\n- glm (0.9.8.5)\n\n## Compilation\n\nTo compile the app, the first thing you need to do is install a C++ compiler:\n\n- Visual Studio (MSVC)\n- Mingw\n- ...\n\nYou also need to install Cmake:  \n\u003chttps://cmake.org\u003e\n\nOnce your environment is set up, depending on your operating system you'll need to install some libs before compiling\nthe project. Refer to the section below `Windows` or `Linux` or `MacOs`.\n\n### Windows\n\nWindows users can directly compile the project by typing the following command at the project root folder:\n\n```bash\ncmake .\n```\n\n\u003e **Note**  \n\u003e If you're using Visual Studio, you can install CMake directly from the IDE (Visual Studio Installer).\n\u003e Then you need to open the Project as a CMake Project, not a Visual Studio Project!\n\n### Linux\n\nLinux's users need to install some libs before compiling the project:\n\nFirst thing to do is to install CMake, type the following command to install it.\n\n```bash\nsudo apt-get install cmake\n```\n\nYou also need to install the GLFW lib. Type the following command at the project root.\n\n```bash\nsudo apt-get install libglfw3-dev\n```\n\nYou are now able to compile the project. Go to the project root and type the following command:\n\n```bash\ncmake .\n```\n\n### MacOs\n\nFor macOS user, you should install brew package manager by following the instructions in the link below:  \n\u003chttps://brew.sh\u003e\n\nThen type the following command to install cmake:\n\n```bash\nbrew install cmake\n```\n\nand this one to install GLFW\n\n```bash\nbrew install glfw\n```\n\nYou are now able to compile the project. Go to the project root and type the following command:\n\n```bash\ncmake .\n```\n\n## Oriented Components Architecture\n\nPlaceholder\n\n\u003c!--\n    //////////////////////////////////\n//    // Method 1\n//    gameObjects[0]-\u003eaddComponentByName(\"Collider\");\n\n//    // Method 2\n//    Collider *collider = nullptr;\n//    gameObjects[0]-\u003eaddComponentByClass\u003cCollider\u003e(collider);\n    //////////////////////////////////\n//    //Method 1\n//    Particle *particle = dynamic_cast\u003cParticle *\u003e(gameObjects[0]-\u003egetComponentByName(\"Particle\"));\n\n//    // Method 2\n//    Collider *particle = nullptr;\n//    gameObjects[0]-\u003egetComponentByClass\u003cCollider\u003e(particle);\n//    std::cout \u003c\u003c particle-\u003egetName() \u003c\u003c std::endl;\n    //////////////////////////////////\n//    //Method 1\n//    Particle *particle = dynamic_cast\u003cParticle *\u003e(gameObjects[0]-\u003eaddComponentByName(\"Particle\"));\n\n//    // Method 2\n//    Collider *particle = nullptr;\n//    gameObjects[0]-\u003edeleteComponentByClass\u003cCollider\u003e(particle);\n    //////////////////////////////////\n--\u003e\n\n## Run tests\n\nA CMake test is set up to directly test the program. You can find it in the `test`folder and start it by typing the\ncommand below at the project root folder.\n\n```bash\nctest\n```\n\n## Github-Actions\n\n[![CodeQL](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/codeql.yml)\n[![CMake](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/cmake.yml)\n[![Cpp Cmake Publish](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/cpp-cmake-publish.yml/badge.svg?branch=main)](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/cpp-cmake-publish.yml)\n[![flawfinder](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/flawfinder.yml/badge.svg?branch=main)](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/flawfinder.yml)\n[![Microsoft C++ Code Analysis](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/msvc.yml/badge.svg?branch=main)](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/msvc.yml)\n[![cpp-linter](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/cpp-linter.yml/badge.svg?branch=main)](https://github.com/Im-Rises/PhysicalEngine/actions/workflows/cpp-linter.yml)\n\nThe project is set with a set of different scripts:\n\n- CodeQL: This script is used to check the code for security issues.\n- CMake: This script is used to build the project.\n- Cpp Cmake Publish: This script is used to publish the project on GitHub.\n- Flawfinder: This script is used to check the code for security issues.\n- Microsoft C++ Code Analysis: This script is used to check the code for security issues.\n- Cpp Linter: This script is used to check the code for security issues.\n\n## Documentations\n\nOpenGL:  \n\u003chttps://www.khronos.org/registry/OpenGL-Refpages/gl4/\u003e\n\nOpenGL loading library:  \n\u003chttps://www.khronos.org/opengl/wiki/OpenGL_Loading_Library\u003e\n\nGLFW:  \n\u003chttps://www.glfw.org/docs/latest/\u003e\n\nDear ImGui:  \n\u003chttps://github.com/ocornut/imgui\u003e\n\nGLAD:  \n\u003chttps://glad.dav1d.de/\u003e\n\nGLM:  \n\u003chttps://glm.g-truc.net/0.9.8/index.html\u003e\n\nSTB:  \n\u003chttps://github.com/nothings/stb\u003e\n\nImPlot:  \n\u003chttps://github.com/epezent/implot\u003e\n\nLearn OpenGL:  \n\u003chttps://learnopengl.com/Getting-started/Hello-Triangle\u003e\n\nDeveloppez Learn OpenGL (Translated in French):  \n\u003chttps://opengl.developpez.com/tutoriels/apprendre-opengl/?page=creer-une-fenetre#L4-5\u003e  \n\u003chttps://opengl.developpez.com/tutoriels/opengl-tutorial/\u003e\n\nSphere OpenGL:  \n\u003chttp://www.songho.ca/opengl/gl_sphere.html\u003e\n\nunrealistic.dev (Change CMake working directory):  \n\u003chttps://unrealistic.dev/posts/setting-debug-parameters-with-cmake-tools-for-visual-studio\u003e\n\n## Contributors\n\nQuentin MOREL:\n\n- @Im-Rises\n- \u003chttps://github.com/Im-Rises\u003e\n\nGabriel REBOUL:\n\n- @spiryti\n- \u003chttps://github.com/spiryti\u003e\n\nClémence CLAVEL:\n\n- @clemos38\n- \u003chttps://github.com/clemos38\u003e\n\n[![GitHub contributors](https://contrib.rocks/image?repo=Im-Rises/PhysicalEngine)](https://github.com/Im-Rises/PhysicalEngine/graphs/contributors)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-rises%2Fphysicalengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fim-rises%2Fphysicalengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-rises%2Fphysicalengine/lists"}