Skip to content

Commit 0b7c3b3

Browse files
authored
feat: migrate to glam whenever relevant + migrate testbed to kiss3d instead of bevy + release v0.32.0 (#909)
* feat: migrate to glam whenever relevant + migrate testbed to kiss3d instead of bevy * chore: update changelog * Fix warnings and tests * Release v0.32.0
1 parent 48de838 commit 0b7c3b3

File tree

265 files changed

+8485
-8559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+8485
-8559
lines changed

.cargo/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[target.wasm32-unknown-unknown]
2+
runner = "wasm-server-runner"
3+
# Needed for getrandom/uuid: https://github.com/uuid-rs/uuid/issues/792
4+
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
## v0.31.0 (09 Jan. 2026)
2+
3+
### Modified
4+
5+
- **Breaking:** Migrate math types from nalgebra to glam (via parry). The main type aliases are now:
6+
- `Isometry<Real>``Pose` (glamx `Pose2/3`)
7+
- `Point<Real>``Vector` for world-space positions (parry no longer distinguishes Point from Vector)
8+
- `Rotation<Real>``Rotation` (glamx `Rot2` or `Quat`)
9+
- `Translation<Real>` → removed, use `Pose::from_translation()`
10+
- nalgebra is still used internally for SIMD code and multibody Jacobians (via `SimdVector<N>`, `SimdPose<N>`, `DVector`, `DMatrix`).
11+
- **Breaking:** Several getters now return by value instead of by reference:
12+
- `RigidBody::linvel()` returns `Vector` instead of `&Vector<Real>`
13+
- `RigidBody::angvel()` returns `AngVector` instead of `&Vector<Real>` (3D) or `Real` (2D)
14+
- `RigidBody::center_of_mass()` returns `Vector` instead of `&Point<Real>`
15+
- `RigidBody::local_center_of_mass()` returns `Vector` instead of `&Point<Real>`
16+
- `Collider::translation()` returns `Vector` instead of `&Vector<Real>`
17+
- `Collider::rotation()` returns `Rotation` instead of `&Rotation<Real>`
18+
- **Breaking:** `DebugRenderBackend::draw_line` signature changed: takes `Vector` instead of `Point<Real>` for line endpoints.
19+
- **Breaking:** `DebugRenderBackend::draw_polyline` and `draw_line_strip` now take `&Pose` and `Vector` instead of `&Isometry<Real>` and `&Vector<Real>`.
20+
- Testbed migrated from Bevy to kiss3d for lighter dependencies and simpler maintenance.
21+
- Removed `benchmarks2d` and `benchmarks3d` crates (merged with `examples2d` and `examples3d`).
22+
23+
### Migration guide
24+
25+
If your codebase currently relies on `nalgebra`, note that `nalgebra` and `glamx` provide type conversion. Enable the
26+
corresponding features:
27+
- `nalgebra = { version = "0.34", features = [ "convert-glam030" ] }`
28+
- `glamx = { version = "0.1", features = ["nalgebra"] }`
29+
then you can convert between `glam` and `nalgebra` types using `.into()`.
30+
31+
1. **Type changes:** Replace `Isometry<Real>` with `Pose`, and `Point<Real>` with `Vector` for positions.
32+
2. **Pose construction:**
33+
- `Isometry::identity()``Pose::IDENTITY`
34+
- `Isometry::translation(x, y, z)``Pose::from_translation(Vector::new(x, y, z))`
35+
- `Isometry::rotation(axis_angle)``Pose::from_rotation(Rotation::from_scaled_axis(axis_angle))`
36+
- `isometry.translation.vector``pose.translation`
37+
- `isometry.rotation.scaled_axis()``pose.rotation.to_scaled_axis()`
38+
3. **Getter usage:** Remove `&` or `.clone()` when using `linvel()`, `angvel()`, `center_of_mass()`, `translation()`, `rotation()` since they now return by value.
39+
4. **Debug renderer:** Update `DebugRenderBackend` implementations to use `Vector` instead of `Point<Real>`.
40+
5. **glam access:** The `glamx` crate is re-exported as `rapier::glamx` for direct glam type access if needed.
41+
142
## v0.31.0 (21 Nov. 2025)
243

344
- `InteractionGroups` struct now contains `InteractionTestMode`.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ members = [
55
"crates/rapier_testbed2d",
66
"crates/rapier_testbed2d-f64",
77
"examples2d",
8-
"benchmarks2d",
98
"crates/rapier3d",
109
"crates/rapier3d-f64",
1110
"crates/rapier_testbed3d",
1211
"crates/rapier_testbed3d-f64",
1312
"examples3d",
1413
"examples3d-f64",
15-
"benchmarks3d",
1614
"crates/rapier3d-urdf",
1715
"crates/rapier3d-meshloader",
1816
]
@@ -34,6 +32,7 @@ needless_lifetimes = "allow"
3432
#nalgebra = { path = "../nalgebra" }
3533
#simba = { path = "../simba" }
3634
#wide = { path = "../wide" }
35+
#glamx = { path = "../glamx" }
3736

3837
#kiss3d = { git = "https://github.com/sebcrozet/kiss3d" }
3938
#nalgebra = { git = "https://github.com/dimforge/nalgebra", branch = "dev" }

0 commit comments

Comments
 (0)