Skip to content

Commit

Permalink
Merge pull request dimforge#436 from dimforge/release-v0.17
Browse files Browse the repository at this point in the history
Release v0.17.0
  • Loading branch information
sebcrozet authored Jan 15, 2023
2 parents 56aa0f5 + 3f5c033 commit ff4c885
Show file tree
Hide file tree
Showing 21 changed files with 139 additions and 122 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## Unreleased
## v0.17.0 (15 Jan. 2022)
### Added
- Add `RigidBody::set_enabled`, `RigidBody::is_enabled`, `RigidBodyBuilder::enabled` to enable/disable a rigid-body
without having to delete it. Disabling a rigid-body attached to a multibody joint isn’t supported yet.
Expand All @@ -11,13 +11,15 @@
a port of the vehicle controller from Bullet physics).
- Add `RigidBody::user_force` and `RigidBody::user_torque` to read the forces or torques added by the user to a
dynamic rigid-body.
- Add `RigidBody::locked_axes` to get the rigid-body axes that were locked by the user.

### Modified
- Add the `QueryPipeline` as an optional argument to `PhysicsPipeline::step` and `CollisionPipeline::step`. If this
argument is specified, then the query pipeline will be incrementally (i.e. more efficiently) update at the same time as
these other pipelines. In that case, calling `QueryPipeline::update` a `PhysicsPipeline::step` isn’t needed.
- `RigidBody::set_body_type` now takes an extra boolean argument indicating if the rigid-body should be woken-up
(if it becomes dynamic).
- `RigidBody::mass_properties` now also returns the world-space mass-properties of the rigid-body.

### Fix
- Fix bug resulting in rigid-bodies being awakened after they are created, even if they are created sleeping.
Expand Down
8 changes: 4 additions & 4 deletions crates/rapier2d-f64/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier2d-f64"
version = "0.16.1"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "2-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier2d"
Expand Down Expand Up @@ -51,9 +51,9 @@ required-features = [ "dim2", "f64" ]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2"
nalgebra = "0.31"
parry2d-f64 = "0.12"
simba = "0.7"
nalgebra = "0.32"
parry2d-f64 = "0.13"
simba = "0.8"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
Expand Down
8 changes: 4 additions & 4 deletions crates/rapier2d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier2d"
version = "0.16.1"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "2-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier2d"
Expand Down Expand Up @@ -51,9 +51,9 @@ required-features = [ "dim2", "f32" ]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2"
nalgebra = "0.31"
parry2d = "0.12"
simba = "0.7"
nalgebra = "0.32"
parry2d = "0.13"
simba = "0.8"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
Expand Down
8 changes: 4 additions & 4 deletions crates/rapier3d-f64/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier3d-f64"
version = "0.16.1"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "3-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier3d"
Expand Down Expand Up @@ -51,9 +51,9 @@ required-features = [ "dim3", "f64" ]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2"
nalgebra = "0.31"
parry3d-f64 = "0.12"
simba = "0.7"
nalgebra = "0.32"
parry3d-f64 = "0.13"
simba = "0.8"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
Expand Down
8 changes: 4 additions & 4 deletions crates/rapier3d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier3d"
version = "0.16.1"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "3-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier3d"
Expand Down Expand Up @@ -51,9 +51,9 @@ required-features = [ "dim3", "f32" ]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2"
nalgebra = "0.31"
parry3d = "0.12"
simba = "0.7"
nalgebra = "0.32"
parry3d = "0.13"
simba = "0.8"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
Expand Down
14 changes: 7 additions & 7 deletions crates/rapier_testbed2d-f64/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier_testbed2d-f64"
version = "0.16.0"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
homepage = "http://rapier.org"
Expand Down Expand Up @@ -28,7 +28,7 @@ other-backends = [ "wrapped2d" ]
features = ["parallel", "other-backends"]

[dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] }
nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]}
Expand All @@ -40,21 +40,21 @@ bincode = "1"
Inflector = "0.11"
md5 = "0.7"

bevy_egui = "0.16"
bevy_ecs = "0.8"
bevy_egui = "0.18"
bevy_ecs = "0.9"
#bevy_prototype_debug_lines = "0.7"

# Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render", "x11"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]}

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]}
#bevy_webgl2 = "0.5"

[dependencies.rapier]
package = "rapier2d-f64"
path = "../rapier2d-f64"
version = "0.16.0"
version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ]
14 changes: 7 additions & 7 deletions crates/rapier_testbed2d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier_testbed2d"
version = "0.16.0"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
homepage = "http://rapier.org"
Expand Down Expand Up @@ -28,7 +28,7 @@ other-backends = [ "wrapped2d" ]
features = ["parallel", "other-backends"]

[dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] }
nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]}
Expand All @@ -40,21 +40,21 @@ bincode = "1"
Inflector = "0.11"
md5 = "0.7"

bevy_egui = "0.16"
bevy_ecs = "0.8"
bevy_egui = "0.18"
bevy_ecs = "0.9"
#bevy_prototype_debug_lines = "0.7"

# Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render", "x11"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]}

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]}
#bevy_webgl2 = "0.5"

[dependencies.rapier]
package = "rapier2d"
path = "../rapier2d"
version = "0.16.0"
version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ]
14 changes: 7 additions & 7 deletions crates/rapier_testbed3d-f64/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier_testbed3d-f64"
version = "0.16.0"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
homepage = "http://rapier.org"
Expand All @@ -27,7 +27,7 @@ parallel = [ "rapier/parallel", "num_cpus" ]
features = ["parallel"]

[dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] }
nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]}
Expand All @@ -39,21 +39,21 @@ md5 = "0.7"
Inflector = "0.11"
serde = { version = "1", features = [ "derive" ] }

bevy_egui = "0.16"
bevy_ecs = "0.8"
bevy_egui = "0.18"
bevy_ecs = "0.9"
#bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] }

# Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render", "x11"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]}

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]}
#bevy_webgl2 = "0.5"

[dependencies.rapier]
package = "rapier3d-f64"
path = "../rapier3d-f64"
version = "0.16.0"
version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ]
20 changes: 10 additions & 10 deletions crates/rapier_testbed3d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rapier_testbed3d"
version = "0.16.0"
version = "0.17.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
homepage = "http://rapier.org"
Expand Down Expand Up @@ -28,36 +28,36 @@ other-backends = [ "physx", "physx-sys", "glam" ]
features = ["parallel", "other-backends"]

[dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] }
nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]}
bitflags = "1"
glam = { version = "0.12", optional = true }
glam = { version = "0.20", optional = true } # For Physx
num_cpus = { version = "1", optional = true }
physx = { version = "0.12", features = [ "glam" ], optional = true }
physx-sys = { version = "0.4", optional = true }
physx = { version = "0.16", features = [ "glam" ], optional = true }
physx-sys = { version = "0.8", optional = true }
crossbeam = "0.8"
bincode = "1"
md5 = "0.7"
Inflector = "0.11"
serde = { version = "1", features = [ "derive" ] }

bevy_egui = "0.16"
bevy_ecs = "0.8"
bevy_egui = "0.18"
bevy_ecs = "0.9"
#bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] }

# Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render", "x11"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]}

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = {version = "0.8", default-features = false, features = ["bevy_winit", "render"]}
bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]}
#bevy_webgl2 = "0.5"

[dependencies.rapier]
package = "rapier3d"
path = "../rapier3d"
version = "0.16.0"
version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ]
30 changes: 14 additions & 16 deletions src/dynamics/joint/multibody_joint/multibody.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ use crate::math::{
};
use crate::prelude::MultibodyJoint;
use crate::utils::{IndexMut2, WAngularInertia, WCross, WCrossMatrix};
use na::{
self, DMatrix, DVector, DVectorSlice, DVectorSliceMut, Dynamic, OMatrix, SMatrix, SVector, LU,
};
use na::{self, DMatrix, DVector, DVectorView, DVectorViewMut, Dyn, OMatrix, SMatrix, SVector, LU};

#[repr(C)]
#[derive(Copy, Clone, Debug, Default)]
Expand Down Expand Up @@ -54,7 +52,7 @@ fn concat_rb_mass_matrix(
result[(1, 1)] = mass.y;
result[(2, 2)] = mass.z;
result
.fixed_slice_mut::<ANG_DIM, ANG_DIM>(DIM, DIM)
.fixed_view_mut::<ANG_DIM, ANG_DIM>(DIM, DIM)
.copy_from(&inertia);
result
}
Expand All @@ -72,10 +70,10 @@ pub struct Multibody {
body_jacobians: Vec<Jacobian<Real>>,
// TODO: use sparse matrices?
augmented_mass: DMatrix<Real>,
inv_augmented_mass: LU<Real, Dynamic, Dynamic>,
inv_augmented_mass: LU<Real, Dyn, Dyn>,

acc_augmented_mass: DMatrix<Real>,
acc_inv_augmented_mass: LU<Real, Dynamic, Dynamic>,
acc_inv_augmented_mass: LU<Real, Dyn, Dyn>,

ndofs: usize,
pub(crate) root_is_dynamic: bool,
Expand All @@ -85,8 +83,8 @@ pub struct Multibody {
* Workspaces.
*/
workspace: MultibodyWorkspace,
coriolis_v: Vec<OMatrix<Real, Dim, Dynamic>>,
coriolis_w: Vec<OMatrix<Real, AngDim, Dynamic>>,
coriolis_v: Vec<OMatrix<Real, Dim, Dyn>>,
coriolis_w: Vec<OMatrix<Real, AngDim, Dyn>>,
i_coriolis_dt: Jacobian<Real>,
}
impl Default for Multibody {
Expand Down Expand Up @@ -234,7 +232,7 @@ impl Multibody {
}

/// The inverse augmented mass matrix of this multibody.
pub fn inv_augmented_mass(&self) -> &LU<Real, Dynamic, Dynamic> {
pub fn inv_augmented_mass(&self) -> &LU<Real, Dyn, Dyn> {
&self.inv_augmented_mass
}

Expand Down Expand Up @@ -547,11 +545,11 @@ impl Multibody {
if self.coriolis_v.len() != self.links.len() {
self.coriolis_v.resize(
self.links.len(),
OMatrix::<Real, Dim, Dynamic>::zeros(self.ndofs),
OMatrix::<Real, Dim, Dyn>::zeros(self.ndofs),
);
self.coriolis_w.resize(
self.links.len(),
OMatrix::<Real, AngDim, Dynamic>::zeros(self.ndofs),
OMatrix::<Real, AngDim, Dyn>::zeros(self.ndofs),
);
self.i_coriolis_dt = Jacobian::zeros(self.ndofs);
}
Expand Down Expand Up @@ -730,29 +728,29 @@ impl Multibody {

/// The generalized velocity at the multibody_joint of the given link.
#[inline]
pub(crate) fn joint_velocity(&self, link: &MultibodyLink) -> DVectorSlice<Real> {
pub(crate) fn joint_velocity(&self, link: &MultibodyLink) -> DVectorView<Real> {
let ndofs = link.joint().ndofs();
DVectorSlice::from_slice(
DVectorView::from_slice(
&self.velocities.as_slice()[link.assembly_id..link.assembly_id + ndofs],
ndofs,
)
}

/// The generalized accelerations of this multibodies.
#[inline]
pub fn generalized_acceleration(&self) -> DVectorSlice<Real> {
pub fn generalized_acceleration(&self) -> DVectorView<Real> {
self.accelerations.rows(0, self.ndofs)
}

/// The generalized velocities of this multibodies.
#[inline]
pub fn generalized_velocity(&self) -> DVectorSlice<Real> {
pub fn generalized_velocity(&self) -> DVectorView<Real> {
self.velocities.rows(0, self.ndofs)
}

/// The mutable generalized velocities of this multibodies.
#[inline]
pub fn generalized_velocity_mut(&mut self) -> DVectorSliceMut<Real> {
pub fn generalized_velocity_mut(&mut self) -> DVectorViewMut<Real> {
self.velocities.rows_mut(0, self.ndofs)
}

Expand Down
Loading

0 comments on commit ff4c885

Please sign in to comment.