Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manevillef/bevy_verlet
Verlet physics plugin for bevy.
https://github.com/manevillef/bevy_verlet
bevy-plugin gamedev physics physics-2d physics-3d rust verlet
Last synced: about 3 hours ago
JSON representation
Verlet physics plugin for bevy.
- Host: GitHub
- URL: https://github.com/manevillef/bevy_verlet
- Owner: ManevilleF
- License: mit
- Created: 2021-09-12T11:16:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-04T20:25:43.000Z (about 2 months ago)
- Last Synced: 2025-02-13T04:18:24.031Z (7 days ago)
- Topics: bevy-plugin, gamedev, physics, physics-2d, physics-3d, rust, verlet
- Language: Rust
- Homepage:
- Size: 44.6 MB
- Stars: 43
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Verlet Integration for Bevy
[](https://github.com/ManevilleF/bevy_verlet/actions/workflows/rust.yml)
[](./LICENSE)
[](https://github.com/rust-secure-code/safety-dance/)
[](https://crates.io/crates/bevy_verlet)
[](https://docs.rs/bevy_verlet)
[](https://deps.rs/crate/bevy_verlet)Simple Verlet points and sticks implementation for bevy.
If you are looking for cloth physics, please check
[`bevy_silk`](https://github.com/ManevilleF/bevy_silk) instead## Bevy versions
| `bevy_verlet` | `bevy` |
|---------------|-----------|
| 0.1.x | 0.5.x |
| 0.2.x | 0.6.x |
| 0.3.x | 0.7.x |
| 0.4.x | 0.8.x |
| 0.5.x | 0.9.x |
| 0.6.x | 0.11.x |
| 0.7.x | 0.12.x |
| 0.8.x | 0.13.x |
| 0.9.x | 0.14.x |## Features
You can simply add a `VerletPoint` component on any entity with a
`Transform` and the verlet physics will apply.Connect points using `VerletStick` to constrain movement (see
[examples](./examples)).Lock some points by adding the `VerletLocked` component on a `VerletPoint`
entity.Customize *friction* and *gravity* with the `VerletConfig` resource.
> Works in 2D and 3D.
## Cargo features
1. `debug`
This feature will add a *system* drawing debug lines for every stick using
bevy gizmos## Examples
### 2D
1. 2D Line
`cargo run --example 2d_line --features "debug"`

2. 2D cloth
`cargo run --example 2d_cloth --features "debug"`

3. 2D cloth cutting
`cargo run --example 2d_cloth_cutter --features "debug"

### 3D
* `cargo run --example 3d_line --features "debug"`
* `cargo run --example 3d_cloth --features "debug"`## Credits
Inspired by:
* This [Sebastian Lague video](https://www.youtube.com/watch?v=PGk0rnyTa1U)
* This [Coding Math course](https://www.youtube.com/watch?v=3HjO_RGIjCU)