Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf authored Dec 8, 2024
2 parents 8c06b49 + ba88219 commit aa772bc
Show file tree
Hide file tree
Showing 112 changed files with 8,735 additions and 5,562 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ jobs:
- name: Run cargo check
run: cargo check

docs:
name: Check Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo doc
run: cargo doc --workspace --no-deps --document-private-items --keep-going
env:
RUSTDOCFLAGS: "-D warnings"

test:
name: Test Suite
strategy:
Expand All @@ -31,7 +42,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
run: cargo test --no-default-features --features enhanced-determinism,collider-from-mesh,serialize,debug-plugin,avian2d/2d,avian3d/3d,avian2d/f64,avian3d/f64,default-collider,parry-f64,bevy_scene
run: cargo test --no-default-features --features enhanced-determinism,collider-from-mesh,serialize,debug-plugin,avian2d/2d,avian3d/3d,avian2d/f64,avian3d/f64,default-collider,parry-f64,bevy_scene,bevy_picking

lints:
name: Lints
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fn setup(
Collider::cuboid(1.0, 1.0, 1.0),
AngularVelocity(Vec3::new(2.5, 3.5, 1.5)),
PbrBundle {
mesh: meshes.add(Cuboid::new(1.0, 1.0, 1.0)),
mesh: meshes.add(Cuboid::from_length(1.0)),
material: materials.add(Color::srgb_u8(124, 144, 255)),
transform: Transform::from_xyz(0.0, 4.0, 0.0),
..default()
Expand All @@ -146,7 +146,7 @@ fn setup(
}
```

![A spinning cube falling onto a circular platform](https://github.com/Jondolf/avian/assets/57632562/d53197fc-e142-4eb9-a762-dc16f6cdb1dd)
![A spinning cube falling onto a circular platform](https://github.com/user-attachments/assets/14d25e7e-9d46-467c-9fe6-dc408cd23398)

## More examples

Expand All @@ -165,9 +165,10 @@ cargo run --example cubes --no-default-features --features "3d f64 parry-f64"

## Supported Bevy versions

| Bevy | Avian |
| ---- | ----- |
| 0.14 | 0.1 |
| Bevy | Avian |
| ------- | ----- |
| 0.15 RC | main |
| 0.14 | 0.1 |

<details>
<summary>Bevy XPBD versions (the predecessor of Avian)</summary>
Expand All @@ -179,6 +180,7 @@ cargo run --example cubes --no-default-features --features "3d f64 parry-f64"
| 0.12 | 0.3 |
| 0.11 | 0.2 |
| 0.10 | 0.1 |

</details>

## Future features
Expand All @@ -199,7 +201,7 @@ For larger changes and additions, it's better to open an issue or ask me for inp
before making a pull request.

You can also ask for help or ask questions on the [Bevy Discord](https://discord.com/invite/gMUk5Ph)
server's `Avian Physics` thread in `#crate-help`. My username on the Discord is `Jondolf` (`@jondolfdev`).
server's Avian Physics topic in `#ecosystem-crates`. My username on the Discord is `Jondolf` (`@jondolfdev`).

## Acknowledgements

Expand Down
52 changes: 37 additions & 15 deletions crates/avian2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ keywords = ["gamedev", "physics", "simulation", "bevy"]
categories = ["game-development", "science", "simulation"]

[features]
default = ["2d", "f32", "parry-f32", "debug-plugin", "parallel", "bevy_scene"]
default = [
"2d",
"f32",
"parry-f32",
"debug-plugin",
"parallel",
"bevy_scene",
"bevy_picking",
]
2d = []
f32 = []
f64 = []
Expand All @@ -25,6 +33,7 @@ enhanced-determinism = [
"parry2d?/enhanced-determinism",
"parry2d-f64?/enhanced-determinism",
"bevy_math/libm",
"bevy_heavy/libm",
]

default-collider = ["dep:nalgebra"]
Expand All @@ -34,11 +43,14 @@ parry-f32 = ["f32", "dep:parry2d", "default-collider"]
parry-f64 = ["f64", "dep:parry2d-f64", "default-collider"]

bevy_scene = ["bevy/bevy_scene"]
bevy_picking = ["bevy/bevy_picking"]
serialize = [
"dep:serde",
"bevy/serialize",
"bevy_transform_interpolation/serialize",
"parry2d?/serde-serialize",
"parry2d-f64?/serde-serialize",
"bitflags/serde",
]

[lib]
Expand All @@ -49,16 +61,16 @@ bench = false

[dependencies]
avian_derive = { path = "../avian_derive", version = "0.1" }
bevy = { version = "0.14", default-features = false }
bevy_math = { version = "0.14" }
bevy = { version = "0.15", default-features = false }
bevy_math = { version = "0.15" }
bevy_heavy = { version = "0.1" }
bevy_transform_interpolation = { version = "0.1" }
libm = { version = "0.2", optional = true }
parry2d = { version = "0.15", optional = true }
parry2d-f64 = { version = "0.15", optional = true }
nalgebra = { version = "0.32.6", features = [
"convert-glam027",
], optional = true }
parry2d = { version = "0.17", optional = true }
parry2d-f64 = { version = "0.17", optional = true }
nalgebra = { version = "0.33", features = ["convert-glam029"], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
derive_more = "0.99"
derive_more = "1"
indexmap = "2.0.0"
fxhash = "0.2.1"
itertools = "0.13"
Expand All @@ -67,10 +79,13 @@ bitflags = "2.5.0"
[dev-dependencies]
examples_common_2d = { path = "../examples_common_2d" }
benches_common_2d = { path = "../benches_common_2d" }
bevy_math = { version = "0.14", features = ["approx"] }
bevy_math = { version = "0.15", features = ["approx"] }
bevy_heavy = { version = "0.1", features = ["approx"] }
glam = { version = "0.29", features = ["bytemuck"] }
approx = "0.5"
bytemuck = "1.19"
criterion = { version = "0.5", features = ["html_reports"] }
insta = "1.0"
bevy_mod_debugdump = { git = "https://github.com/jakobhellermann/bevy_mod_debugdump" }

[[example]]
name = "dynamic_character_2d"
Expand All @@ -96,10 +111,18 @@ required-features = ["2d", "default-collider"]
name = "custom_collider"
required-features = ["2d"]

[[example]]
name = "determinism_2d"
required-features = ["2d", "default-collider", "enhanced-determinism"]

[[example]]
name = "fixed_joint_2d"
required-features = ["2d", "default-collider"]

[[example]]
name = "interpolation"
required-features = ["2d"]

[[example]]
name = "move_marbles"
required-features = ["2d", "default-collider"]
Expand All @@ -116,7 +139,6 @@ required-features = ["2d", "default-collider"]
name = "revolute_joint_2d"
required-features = ["2d", "default-collider"]

[[bench]]
name = "pyramid"
required-features = ["2d", "default-collider"]
harness = false
[[example]]
name = "debugdump_2d"
required-features = ["2d"]
Loading

0 comments on commit aa772bc

Please sign in to comment.