Skip to content

e-yavuz/PhysicsSimulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physics Simulation Project

    .------.
  .'      //`.
 /       //   \ 
|       //     :
:      //      |  
 \    //      /   \
  `._//    _.'  \  
    `"----"'  \

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.

Project Structure

.
├── .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

Key Components

Main Entry Point

  • main.cpp: The main entry point of the application.

Build System

  • Makefile: The makefile to build the project.

Physics Simulation

  • 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.

OpenGL and GLFW Integration

Shaders

Building the Project

To build the project, use the provided Makefile. Ensure that the Cocoa, OpenGL, OpenCL, CoreVideo, and IOKit frameworks are accessible:

make

Running the Project

After building, you can run the project executable generated by the makefile.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published