This project implements a cloth simulation in C++ using the SFML (Simple and Fast Multimedia Library) for rendering and window management.
To build and run this project, ensure you have the following installed:
-
Homebrew (for managing dependencies on macOS)
-
SFML Library (installed via Homebrew)
brew install sfml@2
-
g++ Compiler with C++17 support
main.cpp
: The main source file containing the cloth simulation logic.Makefile
: Build instructions for compiling the project.
-
Clone the repository or download the source files.
git clone <repository-url> cd <project-directory>
-
Build the project using the provided
Makefile
.make
This will compile
main.cpp
and generate an executable namedmain
.
After building the project, run the executable:
./main
- Simulates cloth dynamics using a particle-based approach.
- Implements constraints and spring physics for realistic behavior.
- Renders the simulation using SFML for interactive visualization.
To remove the generated files (executable and object files):
make clean
This project links against the following SFML libraries:
sfml-graphics
sfml-window
sfml-system
These libraries are included via Homebrew at the following paths:
- Include Directory:
/opt/homebrew/opt/sfml@2/include
- Library Directory:
/opt/homebrew/opt/sfml@2/lib
-
Ensure Homebrew's SFML installation paths are correctly set. If you encounter issues, confirm the paths using:
brew info sfml@2
-
The
Makefile
assumes the source file is namedmain.cpp
. Update theSRC
variable in theMakefile
if additional source files are added.