-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 07b84fc.
- Loading branch information
Showing
61 changed files
with
1,351 additions
and
1,225 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,5 @@ lib/*/ | |
imgui.ini | ||
compile_commands.json | ||
.DS_Store | ||
src/web/asteroids.* | ||
src/tests | ||
src/web/sandbox.* | ||
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# C++ Simple physics engine | ||
|
||
Implements a simple physics engine in C++ based on [Verlet integration](https://en.wikipedia.org/wiki/Verlet_integration) and [Verlet constraints](https://en.wikipedia.org/wiki/Verlet_integration#Verlet_constraints). | ||
|
||
<center> | ||
<p float="left" align="center"> | ||
<img src=".github/screenshots/screenshot01.png" style="width: 48%"/> | ||
<img src=".github/screenshots/screenshot02.png" style="width: 48%"/> | ||
</p> | ||
</center> | ||
|
||
<p align="center"> | ||
<a href="https://leandrosq.github.io/cpp-physics-sandbox/">Live demo here</a> | ||
</p> | ||
|
||
## About | ||
|
||
You can check the WEB version [here](https://leandrosq.github.io/cpp-physics-sandbox/). It is a port using WASM generated by Emscripten using WebGL on the browser. | ||
|
||
* Restricted only to circles | ||
* Supports gravity | ||
* Supports collisions | ||
* Implements a Quadtree for collision detection | ||
* Supports constraints | ||
* Implements both a circle and a rectangle world constraint | ||
* Supports user interaction | ||
* Dragging | ||
* Spawning | ||
* Explode | ||
|
||
## Controls | ||
|
||
### Desktop | ||
|
||
> <img src=".github/images/Mouse_Left_Key_Dark.png" align="center" height="32"> `Left click` to spawn circles | ||
> <img src=".github/images/Mouse_Right_Key_Dark.png" align="center" height="32"> `Right click` to drag circles | ||
> <img src=".github/images/Mouse_Middle_Key_Dark.png" align="center" height="32"> `Middle click` to explode circles | ||
> <img src=".github/images/Space_Key_Dark.png" align="center" height="32"> `Space bar` to flip the Gravity vector | ||
> <img src=".github/images/Z_Key_Dark.png" align="center" height="32"> `Z` to toggle Gravity ON/OFF | ||
> <img src=".github/images/Arrow_Up_Key_Dark.png" align="center" height="32"> `Up arrow` to increase the Gravity force | ||
> <img src=".github/images/Arrow_Down_Key_Dark.png" align="center" height="32"> `Down arrow` to decrease the Gravity force | ||
> <img src=".github/images/Arrow_Left_Key_Dark.png" align="center" height="32"> `Left arrow` to decrease the Gravity angle | ||
> <img src=".github/images/Arrow_Right_Key_Dark.png" align="center" height="32"> `Right arrow` to increase the Gravity angle | ||
> <img src=".github/images/Esc_Key_Dark.png" align="center" height="32"> `ESC` to exit | ||
<p float="left" align="center"> | ||
<span>Other controls included on the GUI can be used with the mouse as demonstrated below.</span> | ||
<img src=".github/screenshots/screenshot03.png" style="width: 48%"/> | ||
</p> | ||
|
||
## Project | ||
|
||
### Resources | ||
|
||
| Name | Description | | ||
| -- | -- | | ||
| [ClangD](https://clangd.llvm.org/) | Language Server for C++ | | ||
| [CMake](https://cmake.org/) | Cross-platform open-source make system | | ||
| [Clang-tidy](https://clang.llvm.org/extra/clang-tidy/) | A clang-based C++ “linter” tool | | ||
| [Clang-format](https://clang.llvm.org/docs/ClangFormat.html) | A tool to format C/C++/Obj-C code | | ||
| [Emscripten](https://emscripten.org/) | Used for the web port, generating the WASM binaries. | | ||
| [Raylib](https://www.raylib.com/) | A simple and easy-to-use library to enjoy videogames programming | | ||
| [Dear ImGui](https://www.github.com/ocornut/imgui) | Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies | | ||
| [Dear ImGui Raylib](https:://github.com/RobLoach/raylib-imgui) | Dear ImGui bindings for Raylib | | ||
| [NES CSS](https://nostalgic-css.github.io/NES.css/) | NES.css is NES-style (8bit-like) CSS Framework. | | ||
| Github Actions | Used for CI/CD | | ||
| Github Pages | Used for hosting the web version | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ else | |
exit 1 | ||
fi | ||
|
||
cp ./build/web/asteroids.* ./src/web | ||
cp ./build/web/sandbox.* ./src/web |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.