.------.
.' //`.
/ // \
| // :
: // |
\ // / \
`._// _.' \
`"----"' \
Physics simulation utilizing OpenCL for parallelized collision detection and OpenGL for rendering. This project is focused upon optimized computation and thus only supports simple circle-circle collision, but implements Spatial Hashing, along with a novel, dynamically-sized, shared memory vector system within the GPU for OpenCL calculation.
.
├── .clangd
├── .DS_Store
├── .gitignore
├── .vscode/
│ └── launch.json
├── LICENSE
├──
main.cpp
├── Makefile
└── src/
├── .DS_Store
├── glad.c
├── GLFW/
│ ├── .clangd
│ ├── GLFW_Wrapper.hpp
│ └── Libraries/
│ ├── .DS_Store
│ ├── include/
│ │ ├── .DS_Store
│ │ ├── glad/
│ │ │ └── glad.h
│ │ ├── GLFW/
│ │ │ ├── glfw3.h
│ │ │ └── glfw3native.h
│ │ └── KHR/
│ │ └── khrplatform.h
│ └── lib/
│ └── libglfw.3.3.dylib
├── Physics/
│ ├── Entities/
│ │ ├── Circle.hpp
│ │ └── VerletObject.hpp
│ └──
Solver.hpp
└── Shaders/
├── Collision.cl
├── F1.glsl
├── OpenCL_Wrapper.cpp
├── OpenCL_Wrapper.hpp
└── V1.glsl
- main.cpp: The main entry point of the application.
- Makefile: The makefile to build the project.
- Solver.hpp: Contains the
Solver
class which manages the simulation steps, including updating positions, applying constraints, and handling collisions. - Circle.hpp: Defines the
Circle
entity used in the simulation. - VerletObject.hpp: Defines the
VerletObject
class for physics calculations.
- glad.c: OpenGL loader generated by glad.
- GLFW_Wrapper.hpp: Wrapper for GLFW functionalities.
- GLFW Libraries:
- glad.h: Header for glad.
- glfw3.h: Header for GLFW.
- glfw3native.h: Native header for GLFW.
- khrplatform.h: Khronos platform header.
- libglfw.3.3.dylib: GLFW dynamic library.
- Collision.cl: OpenCL kernel for collision detection.
- F1.glsl: Fragment shader.
- V1.glsl: Vertex shader.
- OpenCL_Wrapper.cpp: Wrapper for OpenCL functionalities.
- OpenCL_Wrapper.hpp: Header for OpenCL wrapper.
To build the project, use the provided Makefile
. Ensure that the Cocoa, OpenGL, OpenCL, CoreVideo, and IOKit frameworks are accessible:
make
After building, you can run the project executable generated by the makefile.
This project is licensed under the MIT License. See the LICENSE file for details.