10 releases (breaking)

0.8.0 Feb 20, 2024
0.7.0 Dec 2, 2023
0.6.1 Jul 27, 2023
0.5.0 Nov 14, 2022
0.1.1 Oct 16, 2021

#993 in Game dev

Download history 125/week @ 2024-02-15 41/week @ 2024-02-22 7/week @ 2024-02-29 1/week @ 2024-03-07 45/week @ 2024-03-28 21/week @ 2024-04-04

66 downloads per month

Custom license

29KB
288 lines

Verlet Integration for Bevy

workflow

MIT licensed unsafe forbidden Crates.io Docs.rs dependency status

Simple Verlet points and sticks implementation for bevy.

If you are looking for cloth physics, please check 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

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

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"

    Alt

  2. 2D cloth

    cargo run --example 2d_cloth --features "debug"

    Alt

  3. 2D cloth cutting

    `cargo run --example 2d_cloth_cutter --features "debug"

    Alt

3D

  • cargo run --example 3d_line --features "debug"
  • cargo run --example 3d_cloth --features "debug"

Credits

Inspired by:

Dependencies

~16–59MB
~1M SLoC