Merge pull request #436 from dimforge/release-v0.17

Release v0.17.0
This commit is contained in:
Sébastien Crozet
2023-01-15 13:01:27 +01:00
committed by GitHub
21 changed files with 139 additions and 122 deletions

View File

@@ -1,5 +1,5 @@
## Unreleased ## v0.17.0 (15 Jan. 2022)
### Added ### Added
- Add `RigidBody::set_enabled`, `RigidBody::is_enabled`, `RigidBodyBuilder::enabled` to enable/disable a rigid-body - 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 isnt supported yet. without having to delete it. Disabling a rigid-body attached to a multibody joint isnt supported yet.
@@ -11,6 +11,7 @@
a port of the vehicle controller from Bullet physics). 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 - Add `RigidBody::user_force` and `RigidBody::user_torque` to read the forces or torques added by the user to a
dynamic rigid-body. dynamic rigid-body.
- Add `RigidBody::locked_axes` to get the rigid-body axes that were locked by the user.
### Modified ### Modified
- Add the `QueryPipeline` as an optional argument to `PhysicsPipeline::step` and `CollisionPipeline::step`. If this - Add the `QueryPipeline` as an optional argument to `PhysicsPipeline::step` and `CollisionPipeline::step`. If this
@@ -18,6 +19,7 @@
these other pipelines. In that case, calling `QueryPipeline::update` a `PhysicsPipeline::step` isnt needed. these other pipelines. In that case, calling `QueryPipeline::update` a `PhysicsPipeline::step` isnt needed.
- `RigidBody::set_body_type` now takes an extra boolean argument indicating if the rigid-body should be woken-up - `RigidBody::set_body_type` now takes an extra boolean argument indicating if the rigid-body should be woken-up
(if it becomes dynamic). (if it becomes dynamic).
- `RigidBody::mass_properties` now also returns the world-space mass-properties of the rigid-body.
### Fix ### Fix
- Fix bug resulting in rigid-bodies being awakened after they are created, even if they are created sleeping. - Fix bug resulting in rigid-bodies being awakened after they are created, even if they are created sleeping.

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier2d-f64" name = "rapier2d-f64"
version = "0.16.1" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "2-dimensional physics engine in Rust." description = "2-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier2d" documentation = "http://docs.rs/rapier2d"
@@ -51,9 +51,9 @@ required-features = [ "dim2", "f64" ]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true } instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.31" nalgebra = "0.32"
parry2d-f64 = "0.12" parry2d-f64 = "0.13"
simba = "0.7" simba = "0.8"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier2d" name = "rapier2d"
version = "0.16.1" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "2-dimensional physics engine in Rust." description = "2-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier2d" documentation = "http://docs.rs/rapier2d"
@@ -51,9 +51,9 @@ required-features = [ "dim2", "f32" ]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true } instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.31" nalgebra = "0.32"
parry2d = "0.12" parry2d = "0.13"
simba = "0.7" simba = "0.8"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier3d-f64" name = "rapier3d-f64"
version = "0.16.1" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "3-dimensional physics engine in Rust." description = "3-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier3d" documentation = "http://docs.rs/rapier3d"
@@ -51,9 +51,9 @@ required-features = [ "dim3", "f64" ]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true } instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.31" nalgebra = "0.32"
parry3d-f64 = "0.12" parry3d-f64 = "0.13"
simba = "0.7" simba = "0.8"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier3d" name = "rapier3d"
version = "0.16.1" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "3-dimensional physics engine in Rust." description = "3-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier3d" documentation = "http://docs.rs/rapier3d"
@@ -51,9 +51,9 @@ required-features = [ "dim3", "f32" ]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = [ "now" ], optional = true } instant = { version = "0.1", features = [ "now" ], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.31" nalgebra = "0.32"
parry3d = "0.12" parry3d = "0.13"
simba = "0.7" simba = "0.8"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier_testbed2d-f64" name = "rapier_testbed2d-f64"
version = "0.16.0" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "Testbed for the Rapier 2-dimensional physics engine in Rust." description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
homepage = "http://rapier.org" homepage = "http://rapier.org"
@@ -28,7 +28,7 @@ other-backends = [ "wrapped2d" ]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] } nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]} instant = { version = "0.1", features = [ "web-sys", "now" ]}
@@ -40,21 +40,21 @@ bincode = "1"
Inflector = "0.11" Inflector = "0.11"
md5 = "0.7" md5 = "0.7"
bevy_egui = "0.16" bevy_egui = "0.18"
bevy_ecs = "0.8" bevy_ecs = "0.9"
#bevy_prototype_debug_lines = "0.7" #bevy_prototype_debug_lines = "0.7"
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [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. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [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" #bevy_webgl2 = "0.5"
[dependencies.rapier] [dependencies.rapier]
package = "rapier2d-f64" package = "rapier2d-f64"
path = "../rapier2d-f64" path = "../rapier2d-f64"
version = "0.16.0" version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ] features = [ "serde-serialize", "debug-render", "profiler" ]

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier_testbed2d" name = "rapier_testbed2d"
version = "0.16.0" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "Testbed for the Rapier 2-dimensional physics engine in Rust." description = "Testbed for the Rapier 2-dimensional physics engine in Rust."
homepage = "http://rapier.org" homepage = "http://rapier.org"
@@ -28,7 +28,7 @@ other-backends = [ "wrapped2d" ]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] } nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]} instant = { version = "0.1", features = [ "web-sys", "now" ]}
@@ -40,21 +40,21 @@ bincode = "1"
Inflector = "0.11" Inflector = "0.11"
md5 = "0.7" md5 = "0.7"
bevy_egui = "0.16" bevy_egui = "0.18"
bevy_ecs = "0.8" bevy_ecs = "0.9"
#bevy_prototype_debug_lines = "0.7" #bevy_prototype_debug_lines = "0.7"
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [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. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [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" #bevy_webgl2 = "0.5"
[dependencies.rapier] [dependencies.rapier]
package = "rapier2d" package = "rapier2d"
path = "../rapier2d" path = "../rapier2d"
version = "0.16.0" version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ] features = [ "serde-serialize", "debug-render", "profiler" ]

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier_testbed3d-f64" name = "rapier_testbed3d-f64"
version = "0.16.0" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "Testbed for the Rapier 3-dimensional physics engine in Rust." description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
homepage = "http://rapier.org" homepage = "http://rapier.org"
@@ -27,7 +27,7 @@ parallel = [ "rapier/parallel", "num_cpus" ]
features = ["parallel"] features = ["parallel"]
[dependencies] [dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] } nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]} instant = { version = "0.1", features = [ "web-sys", "now" ]}
@@ -39,21 +39,21 @@ md5 = "0.7"
Inflector = "0.11" Inflector = "0.11"
serde = { version = "1", features = [ "derive" ] } serde = { version = "1", features = [ "derive" ] }
bevy_egui = "0.16" bevy_egui = "0.18"
bevy_ecs = "0.8" bevy_ecs = "0.9"
#bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] } #bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] }
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [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. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [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" #bevy_webgl2 = "0.5"
[dependencies.rapier] [dependencies.rapier]
package = "rapier3d-f64" package = "rapier3d-f64"
path = "../rapier3d-f64" path = "../rapier3d-f64"
version = "0.16.0" version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ] features = [ "serde-serialize", "debug-render", "profiler" ]

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rapier_testbed3d" name = "rapier_testbed3d"
version = "0.16.0" version = "0.17.0"
authors = [ "Sébastien Crozet <developer@crozet.re>" ] authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "Testbed for the Rapier 3-dimensional physics engine in Rust." description = "Testbed for the Rapier 3-dimensional physics engine in Rust."
homepage = "http://rapier.org" homepage = "http://rapier.org"
@@ -28,36 +28,36 @@ other-backends = [ "physx", "physx-sys", "glam" ]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.31", features = [ "rand" ] } nalgebra = { version = "0.32", features = [ "rand" ] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = [ "web-sys", "now" ]} instant = { version = "0.1", features = [ "web-sys", "now" ]}
bitflags = "1" bitflags = "1"
glam = { version = "0.12", optional = true } glam = { version = "0.20", optional = true } # For Physx
num_cpus = { version = "1", optional = true } num_cpus = { version = "1", optional = true }
physx = { version = "0.12", features = [ "glam" ], optional = true } physx = { version = "0.16", features = [ "glam" ], optional = true }
physx-sys = { version = "0.4", optional = true } physx-sys = { version = "0.8", optional = true }
crossbeam = "0.8" crossbeam = "0.8"
bincode = "1" bincode = "1"
md5 = "0.7" md5 = "0.7"
Inflector = "0.11" Inflector = "0.11"
serde = { version = "1", features = [ "derive" ] } serde = { version = "1", features = [ "derive" ] }
bevy_egui = "0.16" bevy_egui = "0.18"
bevy_ecs = "0.8" bevy_ecs = "0.9"
#bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] } #bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] }
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [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. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [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" #bevy_webgl2 = "0.5"
[dependencies.rapier] [dependencies.rapier]
package = "rapier3d" package = "rapier3d"
path = "../rapier3d" path = "../rapier3d"
version = "0.16.0" version = "0.17.0"
features = [ "serde-serialize", "debug-render", "profiler" ] features = [ "serde-serialize", "debug-render", "profiler" ]

View File

@@ -11,9 +11,7 @@ use crate::math::{
}; };
use crate::prelude::MultibodyJoint; use crate::prelude::MultibodyJoint;
use crate::utils::{IndexMut2, WAngularInertia, WCross, WCrossMatrix}; use crate::utils::{IndexMut2, WAngularInertia, WCross, WCrossMatrix};
use na::{ use na::{self, DMatrix, DVector, DVectorView, DVectorViewMut, Dyn, OMatrix, SMatrix, SVector, LU};
self, DMatrix, DVector, DVectorSlice, DVectorSliceMut, Dynamic, OMatrix, SMatrix, SVector, LU,
};
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone, Debug, Default)] #[derive(Copy, Clone, Debug, Default)]
@@ -54,7 +52,7 @@ fn concat_rb_mass_matrix(
result[(1, 1)] = mass.y; result[(1, 1)] = mass.y;
result[(2, 2)] = mass.z; result[(2, 2)] = mass.z;
result result
.fixed_slice_mut::<ANG_DIM, ANG_DIM>(DIM, DIM) .fixed_view_mut::<ANG_DIM, ANG_DIM>(DIM, DIM)
.copy_from(&inertia); .copy_from(&inertia);
result result
} }
@@ -72,10 +70,10 @@ pub struct Multibody {
body_jacobians: Vec<Jacobian<Real>>, body_jacobians: Vec<Jacobian<Real>>,
// TODO: use sparse matrices? // TODO: use sparse matrices?
augmented_mass: DMatrix<Real>, augmented_mass: DMatrix<Real>,
inv_augmented_mass: LU<Real, Dynamic, Dynamic>, inv_augmented_mass: LU<Real, Dyn, Dyn>,
acc_augmented_mass: DMatrix<Real>, acc_augmented_mass: DMatrix<Real>,
acc_inv_augmented_mass: LU<Real, Dynamic, Dynamic>, acc_inv_augmented_mass: LU<Real, Dyn, Dyn>,
ndofs: usize, ndofs: usize,
pub(crate) root_is_dynamic: bool, pub(crate) root_is_dynamic: bool,
@@ -85,8 +83,8 @@ pub struct Multibody {
* Workspaces. * Workspaces.
*/ */
workspace: MultibodyWorkspace, workspace: MultibodyWorkspace,
coriolis_v: Vec<OMatrix<Real, Dim, Dynamic>>, coriolis_v: Vec<OMatrix<Real, Dim, Dyn>>,
coriolis_w: Vec<OMatrix<Real, AngDim, Dynamic>>, coriolis_w: Vec<OMatrix<Real, AngDim, Dyn>>,
i_coriolis_dt: Jacobian<Real>, i_coriolis_dt: Jacobian<Real>,
} }
impl Default for Multibody { impl Default for Multibody {
@@ -234,7 +232,7 @@ impl Multibody {
} }
/// The inverse augmented mass matrix of this 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 &self.inv_augmented_mass
} }
@@ -547,11 +545,11 @@ impl Multibody {
if self.coriolis_v.len() != self.links.len() { if self.coriolis_v.len() != self.links.len() {
self.coriolis_v.resize( self.coriolis_v.resize(
self.links.len(), self.links.len(),
OMatrix::<Real, Dim, Dynamic>::zeros(self.ndofs), OMatrix::<Real, Dim, Dyn>::zeros(self.ndofs),
); );
self.coriolis_w.resize( self.coriolis_w.resize(
self.links.len(), 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); self.i_coriolis_dt = Jacobian::zeros(self.ndofs);
} }
@@ -730,9 +728,9 @@ impl Multibody {
/// The generalized velocity at the multibody_joint of the given link. /// The generalized velocity at the multibody_joint of the given link.
#[inline] #[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(); let ndofs = link.joint().ndofs();
DVectorSlice::from_slice( DVectorView::from_slice(
&self.velocities.as_slice()[link.assembly_id..link.assembly_id + ndofs], &self.velocities.as_slice()[link.assembly_id..link.assembly_id + ndofs],
ndofs, ndofs,
) )
@@ -740,19 +738,19 @@ impl Multibody {
/// The generalized accelerations of this multibodies. /// The generalized accelerations of this multibodies.
#[inline] #[inline]
pub fn generalized_acceleration(&self) -> DVectorSlice<Real> { pub fn generalized_acceleration(&self) -> DVectorView<Real> {
self.accelerations.rows(0, self.ndofs) self.accelerations.rows(0, self.ndofs)
} }
/// The generalized velocities of this multibodies. /// The generalized velocities of this multibodies.
#[inline] #[inline]
pub fn generalized_velocity(&self) -> DVectorSlice<Real> { pub fn generalized_velocity(&self) -> DVectorView<Real> {
self.velocities.rows(0, self.ndofs) self.velocities.rows(0, self.ndofs)
} }
/// The mutable generalized velocities of this multibodies. /// The mutable generalized velocities of this multibodies.
#[inline] #[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) self.velocities.rows_mut(0, self.ndofs)
} }

View File

@@ -4,10 +4,10 @@ use crate::dynamics::{
RigidBodyVelocity, RigidBodyVelocity,
}; };
use crate::math::{ use crate::math::{
Isometry, JacobianSliceMut, Real, Rotation, SpacialVector, Translation, Vector, ANG_DIM, DIM, Isometry, JacobianViewMut, Real, Rotation, SpacialVector, Translation, Vector, ANG_DIM, DIM,
SPATIAL_DIM, SPATIAL_DIM,
}; };
use na::{DVector, DVectorSliceMut}; use na::{DVector, DVectorViewMut};
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
use na::{UnitQuaternion, Vector3}; use na::{UnitQuaternion, Vector3};
@@ -126,14 +126,14 @@ impl MultibodyJoint {
} }
/// Sets in `out` the non-zero entries of the multibody_joint jacobian transformed by `transform`. /// Sets in `out` the non-zero entries of the multibody_joint jacobian transformed by `transform`.
pub fn jacobian(&self, transform: &Rotation<Real>, out: &mut JacobianSliceMut<Real>) { pub fn jacobian(&self, transform: &Rotation<Real>, out: &mut JacobianViewMut<Real>) {
let locked_bits = self.data.locked_axes.bits(); let locked_bits = self.data.locked_axes.bits();
let mut curr_free_dof = 0; let mut curr_free_dof = 0;
for i in 0..DIM { for i in 0..DIM {
if (locked_bits & (1 << i)) == 0 { if (locked_bits & (1 << i)) == 0 {
let transformed_axis = transform * Vector::ith(i, 1.0); let transformed_axis = transform * Vector::ith(i, 1.0);
out.fixed_slice_mut::<DIM, 1>(0, curr_free_dof) out.fixed_view_mut::<DIM, 1>(0, curr_free_dof)
.copy_from(&transformed_axis); .copy_from(&transformed_axis);
curr_free_dof += 1; curr_free_dof += 1;
} }
@@ -153,7 +153,7 @@ impl MultibodyJoint {
{ {
let dof_id = (!locked_ang_bits).trailing_zeros() as usize; let dof_id = (!locked_ang_bits).trailing_zeros() as usize;
let rotmat = transform.to_rotation_matrix().into_inner(); let rotmat = transform.to_rotation_matrix().into_inner();
out.fixed_slice_mut::<ANG_DIM, 1>(DIM, curr_free_dof) out.fixed_view_mut::<ANG_DIM, 1>(DIM, curr_free_dof)
.copy_from(&rotmat.column(dof_id)); .copy_from(&rotmat.column(dof_id));
} }
} }
@@ -163,7 +163,7 @@ impl MultibodyJoint {
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
3 => { 3 => {
let rotmat = transform.to_rotation_matrix(); let rotmat = transform.to_rotation_matrix();
out.fixed_slice_mut::<3, 3>(3, curr_free_dof) out.fixed_view_mut::<3, 3>(3, curr_free_dof)
.copy_from(rotmat.matrix()); .copy_from(rotmat.matrix());
} }
_ => unreachable!(), _ => unreachable!(),
@@ -213,7 +213,7 @@ impl MultibodyJoint {
} }
/// Fill `out` with the non-zero entries of a damping that can be applied by default to ensure a good stability of the multibody_joint. /// Fill `out` with the non-zero entries of a damping that can be applied by default to ensure a good stability of the multibody_joint.
pub fn default_damping(&self, out: &mut DVectorSliceMut<Real>) { pub fn default_damping(&self, out: &mut DVectorViewMut<Real>) {
let locked_bits = self.data.locked_axes.bits(); let locked_bits = self.data.locked_axes.bits();
let mut curr_free_dof = self.num_free_lin_dofs(); let mut curr_free_dof = self.num_free_lin_dofs();

View File

@@ -158,8 +158,8 @@ impl RigidBody {
/// The mass-properties of this rigid-body. /// The mass-properties of this rigid-body.
#[inline] #[inline]
pub fn mass_properties(&self) -> &MassProperties { pub fn mass_properties(&self) -> &RigidBodyMassProps {
&self.mprops.local_mprops &self.mprops
} }
/// The dominance group of this rigid-body. /// The dominance group of this rigid-body.
@@ -184,6 +184,12 @@ impl RigidBody {
} }
} }
/// The axes along which this rigid-body cannot translate or rotate.
#[inline]
pub fn locked_axes(&self) -> LockedAxes {
self.mprops.flags
}
#[inline] #[inline]
/// Locks or unlocks all the rotations of this rigid-body. /// Locks or unlocks all the rotations of this rigid-body.
pub fn lock_rotations(&mut self, locked: bool, wake_up: bool) { pub fn lock_rotations(&mut self, locked: bool, wake_up: bool) {

View File

@@ -245,7 +245,7 @@ impl Default for RigidBodyAdditionalMassProps {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
/// The mass properties of this rigid-bodies. /// The mass properties of a rigid-body.
pub struct RigidBodyMassProps { pub struct RigidBodyMassProps {
/// Flags for locking rotation and translation. /// Flags for locking rotation and translation.
pub flags: LockedAxes, pub flags: LockedAxes,

View File

@@ -1,6 +1,6 @@
use crate::math::{AngVector, Vector, SPATIAL_DIM}; use crate::math::{AngVector, Vector, SPATIAL_DIM};
use crate::utils::WReal; use crate::utils::WReal;
use na::{DVectorSlice, DVectorSliceMut, Scalar}; use na::{DVectorView, DVectorViewMut, Scalar};
use std::ops::{AddAssign, Sub}; use std::ops::{AddAssign, Sub};
#[derive(Copy, Clone, Debug, Default)] #[derive(Copy, Clone, Debug, Default)]
@@ -20,12 +20,12 @@ impl<N: Scalar + Copy> DeltaVel<N> {
unsafe { std::mem::transmute(self) } unsafe { std::mem::transmute(self) }
} }
pub fn as_vector_slice(&self) -> DVectorSlice<N> { pub fn as_vector_slice(&self) -> DVectorView<N> {
DVectorSlice::from_slice(&self.as_slice()[..], SPATIAL_DIM) DVectorView::from_slice(&self.as_slice()[..], SPATIAL_DIM)
} }
pub fn as_vector_slice_mut(&mut self) -> DVectorSliceMut<N> { pub fn as_vector_slice_mut(&mut self) -> DVectorViewMut<N> {
DVectorSliceMut::from_slice(&mut self.as_mut_slice()[..], SPATIAL_DIM) DVectorViewMut::from_slice(&mut self.as_mut_slice()[..], SPATIAL_DIM)
} }
} }

View File

@@ -4,7 +4,7 @@ use crate::dynamics::solver::DeltaVel;
use crate::dynamics::{GenericJoint, IntegrationParameters, JointGraphEdge, JointIndex, Multibody}; use crate::dynamics::{GenericJoint, IntegrationParameters, JointGraphEdge, JointIndex, Multibody};
use crate::math::{Isometry, Real, DIM}; use crate::math::{Isometry, Real, DIM};
use crate::prelude::SPATIAL_DIM; use crate::prelude::SPATIAL_DIM;
use na::{DVector, DVectorSlice, DVectorSliceMut}; use na::{DVector, DVectorView, DVectorViewMut};
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct JointGenericVelocityConstraint { pub struct JointGenericVelocityConstraint {
@@ -222,7 +222,7 @@ impl JointGenericVelocityConstraint {
&self, &self,
mj_lambdas: &'a [DeltaVel<Real>], mj_lambdas: &'a [DeltaVel<Real>],
generic_mj_lambdas: &'a DVector<Real>, generic_mj_lambdas: &'a DVector<Real>,
) -> DVectorSlice<'a, Real> { ) -> DVectorView<'a, Real> {
if self.is_rigid_body1 { if self.is_rigid_body1 {
mj_lambdas[self.mj_lambda1].as_vector_slice() mj_lambdas[self.mj_lambda1].as_vector_slice()
} else { } else {
@@ -234,7 +234,7 @@ impl JointGenericVelocityConstraint {
&self, &self,
mj_lambdas: &'a mut [DeltaVel<Real>], mj_lambdas: &'a mut [DeltaVel<Real>],
generic_mj_lambdas: &'a mut DVector<Real>, generic_mj_lambdas: &'a mut DVector<Real>,
) -> DVectorSliceMut<'a, Real> { ) -> DVectorViewMut<'a, Real> {
if self.is_rigid_body1 { if self.is_rigid_body1 {
mj_lambdas[self.mj_lambda1].as_vector_slice_mut() mj_lambdas[self.mj_lambda1].as_vector_slice_mut()
} else { } else {
@@ -246,7 +246,7 @@ impl JointGenericVelocityConstraint {
&self, &self,
mj_lambdas: &'a [DeltaVel<Real>], mj_lambdas: &'a [DeltaVel<Real>],
generic_mj_lambdas: &'a DVector<Real>, generic_mj_lambdas: &'a DVector<Real>,
) -> DVectorSlice<'a, Real> { ) -> DVectorView<'a, Real> {
if self.is_rigid_body2 { if self.is_rigid_body2 {
mj_lambdas[self.mj_lambda2].as_vector_slice() mj_lambdas[self.mj_lambda2].as_vector_slice()
} else { } else {
@@ -258,7 +258,7 @@ impl JointGenericVelocityConstraint {
&self, &self,
mj_lambdas: &'a mut [DeltaVel<Real>], mj_lambdas: &'a mut [DeltaVel<Real>],
generic_mj_lambdas: &'a mut DVector<Real>, generic_mj_lambdas: &'a mut DVector<Real>,
) -> DVectorSliceMut<'a, Real> { ) -> DVectorViewMut<'a, Real> {
if self.is_rigid_body2 { if self.is_rigid_body2 {
mj_lambdas[self.mj_lambda2].as_vector_slice_mut() mj_lambdas[self.mj_lambda2].as_vector_slice_mut()
} else { } else {
@@ -275,11 +275,11 @@ impl JointGenericVelocityConstraint {
let jacobians = jacobians.as_slice(); let jacobians = jacobians.as_slice();
let mj_lambda1 = self.mj_lambda1(mj_lambdas, generic_mj_lambdas); let mj_lambda1 = self.mj_lambda1(mj_lambdas, generic_mj_lambdas);
let j1 = DVectorSlice::from_slice(&jacobians[self.j_id1..], self.ndofs1); let j1 = DVectorView::from_slice(&jacobians[self.j_id1..], self.ndofs1);
let vel1 = j1.dot(&mj_lambda1); let vel1 = j1.dot(&mj_lambda1);
let mj_lambda2 = self.mj_lambda2(mj_lambdas, generic_mj_lambdas); let mj_lambda2 = self.mj_lambda2(mj_lambdas, generic_mj_lambdas);
let j2 = DVectorSlice::from_slice(&jacobians[self.j_id2..], self.ndofs2); let j2 = DVectorView::from_slice(&jacobians[self.j_id2..], self.ndofs2);
let vel2 = j2.dot(&mj_lambda2); let vel2 = j2.dot(&mj_lambda2);
let dvel = self.rhs + (vel2 - vel1); let dvel = self.rhs + (vel2 - vel1);
@@ -292,11 +292,11 @@ impl JointGenericVelocityConstraint {
self.impulse = total_impulse; self.impulse = total_impulse;
let mut mj_lambda1 = self.mj_lambda1_mut(mj_lambdas, generic_mj_lambdas); let mut mj_lambda1 = self.mj_lambda1_mut(mj_lambdas, generic_mj_lambdas);
let wj1 = DVectorSlice::from_slice(&jacobians[self.wj_id1()..], self.ndofs1); let wj1 = DVectorView::from_slice(&jacobians[self.wj_id1()..], self.ndofs1);
mj_lambda1.axpy(delta_impulse, &wj1, 1.0); mj_lambda1.axpy(delta_impulse, &wj1, 1.0);
let mut mj_lambda2 = self.mj_lambda2_mut(mj_lambdas, generic_mj_lambdas); let mut mj_lambda2 = self.mj_lambda2_mut(mj_lambdas, generic_mj_lambdas);
let wj2 = DVectorSlice::from_slice(&jacobians[self.wj_id2()..], self.ndofs2); let wj2 = DVectorView::from_slice(&jacobians[self.wj_id2()..], self.ndofs2);
mj_lambda2.axpy(-delta_impulse, &wj2, 1.0); mj_lambda2.axpy(-delta_impulse, &wj2, 1.0);
} }
@@ -506,7 +506,7 @@ impl JointGenericVelocityGroundConstraint {
&self, &self,
_mj_lambdas: &'a [DeltaVel<Real>], _mj_lambdas: &'a [DeltaVel<Real>],
generic_mj_lambdas: &'a DVector<Real>, generic_mj_lambdas: &'a DVector<Real>,
) -> DVectorSlice<'a, Real> { ) -> DVectorView<'a, Real> {
generic_mj_lambdas.rows(self.mj_lambda2, self.ndofs2) generic_mj_lambdas.rows(self.mj_lambda2, self.ndofs2)
} }
@@ -514,7 +514,7 @@ impl JointGenericVelocityGroundConstraint {
&self, &self,
_mj_lambdas: &'a mut [DeltaVel<Real>], _mj_lambdas: &'a mut [DeltaVel<Real>],
generic_mj_lambdas: &'a mut DVector<Real>, generic_mj_lambdas: &'a mut DVector<Real>,
) -> DVectorSliceMut<'a, Real> { ) -> DVectorViewMut<'a, Real> {
generic_mj_lambdas.rows_mut(self.mj_lambda2, self.ndofs2) generic_mj_lambdas.rows_mut(self.mj_lambda2, self.ndofs2)
} }
@@ -527,7 +527,7 @@ impl JointGenericVelocityGroundConstraint {
let jacobians = jacobians.as_slice(); let jacobians = jacobians.as_slice();
let mj_lambda2 = self.mj_lambda2(mj_lambdas, generic_mj_lambdas); let mj_lambda2 = self.mj_lambda2(mj_lambdas, generic_mj_lambdas);
let j2 = DVectorSlice::from_slice(&jacobians[self.j_id2..], self.ndofs2); let j2 = DVectorView::from_slice(&jacobians[self.j_id2..], self.ndofs2);
let vel2 = j2.dot(&mj_lambda2); let vel2 = j2.dot(&mj_lambda2);
let dvel = self.rhs + vel2; let dvel = self.rhs + vel2;
@@ -540,7 +540,7 @@ impl JointGenericVelocityGroundConstraint {
self.impulse = total_impulse; self.impulse = total_impulse;
let mut mj_lambda2 = self.mj_lambda2_mut(mj_lambdas, generic_mj_lambdas); let mut mj_lambda2 = self.mj_lambda2_mut(mj_lambdas, generic_mj_lambdas);
let wj2 = DVectorSlice::from_slice(&jacobians[self.wj_id2()..], self.ndofs2); let wj2 = DVectorView::from_slice(&jacobians[self.wj_id2()..], self.ndofs2);
mj_lambda2.axpy(-delta_impulse, &wj2, 1.0); mj_lambda2.axpy(-delta_impulse, &wj2, 1.0);
} }

View File

@@ -157,11 +157,11 @@ pub mod math {
/// The type of a slice of the constraint Jacobian in twist coordinates. /// The type of a slice of the constraint Jacobian in twist coordinates.
#[cfg(feature = "dim2")] #[cfg(feature = "dim2")]
pub type JacobianSlice<'a, N> = na::MatrixSlice3xX<'a, N>; pub type JacobianView<'a, N> = na::MatrixView3xX<'a, N>;
/// The type of a mutable slice of the constraint Jacobian in twist coordinates. /// The type of a mutable slice of the constraint Jacobian in twist coordinates.
#[cfg(feature = "dim2")] #[cfg(feature = "dim2")]
pub type JacobianSliceMut<'a, N> = na::MatrixSliceMut3xX<'a, N>; pub type JacobianViewMut<'a, N> = na::MatrixViewMut3xX<'a, N>;
/// The maximum number of possible rotations and translations of a rigid body. /// The maximum number of possible rotations and translations of a rigid body.
#[cfg(feature = "dim2")] #[cfg(feature = "dim2")]
@@ -186,11 +186,11 @@ pub mod math {
/// The type of a slice of the constraint Jacobian in twist coordinates. /// The type of a slice of the constraint Jacobian in twist coordinates.
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
pub type JacobianSlice<'a, N> = na::MatrixSlice6xX<'a, N>; pub type JacobianView<'a, N> = na::MatrixView6xX<'a, N>;
/// The type of a mutable slice of the constraint Jacobian in twist coordinates. /// The type of a mutable slice of the constraint Jacobian in twist coordinates.
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
pub type JacobianSliceMut<'a, N> = na::MatrixSliceMut6xX<'a, N>; pub type JacobianViewMut<'a, N> = na::MatrixViewMut6xX<'a, N>;
/// The maximum number of possible rotations and translations of a rigid body. /// The maximum number of possible rotations and translations of a rigid body.
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]

View File

@@ -6,6 +6,9 @@ use rapier::pipeline::{
DebugRenderBackend, DebugRenderMode, DebugRenderObject, DebugRenderPipeline, DebugRenderBackend, DebugRenderMode, DebugRenderObject, DebugRenderPipeline,
}; };
#[derive(Resource)]
pub struct DebugRenderPipelineResource(pub DebugRenderPipeline);
pub struct RapierDebugRenderPlugin { pub struct RapierDebugRenderPlugin {
depth_test: bool, depth_test: bool,
} }
@@ -23,10 +26,10 @@ impl Plugin for RapierDebugRenderPlugin {
app.add_plugin(crate::lines::DebugLinesPlugin::with_depth_test( app.add_plugin(crate::lines::DebugLinesPlugin::with_depth_test(
self.depth_test, self.depth_test,
)) ))
.insert_resource(DebugRenderPipeline::new( .insert_resource(DebugRenderPipelineResource(DebugRenderPipeline::new(
Default::default(), Default::default(),
!DebugRenderMode::RIGID_BODY_AXES & !DebugRenderMode::COLLIDER_AABBS, !DebugRenderMode::RIGID_BODY_AXES & !DebugRenderMode::COLLIDER_AABBS,
)) )))
.add_system_to_stage(CoreStage::Update, debug_render_scene); .add_system_to_stage(CoreStage::Update, debug_render_scene);
} }
} }
@@ -57,12 +60,12 @@ impl<'a> DebugRenderBackend for BevyLinesRenderBackend<'a> {
} }
fn debug_render_scene( fn debug_render_scene(
mut pipeline: ResMut<DebugRenderPipeline>, mut pipeline: ResMut<DebugRenderPipelineResource>,
harness: NonSend<Harness>, harness: NonSend<Harness>,
mut lines: ResMut<DebugLines>, mut lines: ResMut<DebugLines>,
) { ) {
let mut backend = BevyLinesRenderBackend { lines: &mut *lines }; let mut backend = BevyLinesRenderBackend { lines: &mut *lines };
pipeline.render( pipeline.0.render(
&mut backend, &mut backend,
&harness.physics.bodies, &harness.physics.bodies,
&harness.physics.colliders, &harness.physics.colliders,

View File

@@ -73,6 +73,7 @@ mod dim {
pub(crate) const DEBUG_LINES_SHADER_HANDLE: HandleUntyped = pub(crate) const DEBUG_LINES_SHADER_HANDLE: HandleUntyped =
HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 17477439189930443325); HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 17477439189930443325);
#[derive(Resource)]
pub(crate) struct DebugLinesConfig { pub(crate) struct DebugLinesConfig {
depth_test: bool, depth_test: bool,
} }
@@ -275,7 +276,7 @@ pub(crate) struct RenderDebugLinesMesh;
/// ); /// );
/// } /// }
/// ``` /// ```
#[derive(Default)] #[derive(Default, Resource)]
pub struct DebugLines { pub struct DebugLines {
pub positions: Vec<[f32; 3]>, pub positions: Vec<[f32; 3]>,
//pub colors: Vec<[f32; 4]>, //pub colors: Vec<[f32; 4]>,

View File

@@ -26,6 +26,7 @@ pub mod r3d {
use crate::lines::{DebugLinesConfig, RenderDebugLinesMesh, DEBUG_LINES_SHADER_HANDLE}; use crate::lines::{DebugLinesConfig, RenderDebugLinesMesh, DEBUG_LINES_SHADER_HANDLE};
#[derive(Resource)]
pub(crate) struct DebugLinePipeline { pub(crate) struct DebugLinePipeline {
mesh_pipeline: MeshPipeline, mesh_pipeline: MeshPipeline,
shader: Handle<Shader>, shader: Handle<Shader>,
@@ -208,6 +209,7 @@ pub mod r2d {
use crate::lines::{RenderDebugLinesMesh, DEBUG_LINES_SHADER_HANDLE}; use crate::lines::{RenderDebugLinesMesh, DEBUG_LINES_SHADER_HANDLE};
#[derive(Resource)]
pub(crate) struct DebugLinePipeline { pub(crate) struct DebugLinePipeline {
mesh_pipeline: Mesh2dPipeline, mesh_pipeline: Mesh2dPipeline,
shader: Handle<Shader>, shader: Handle<Shader>,

View File

@@ -44,7 +44,7 @@ impl EntityWithGraphics {
color: Point3<f32>, color: Point3<f32>,
sensor: bool, sensor: bool,
) -> Self { ) -> Self {
let entity = commands.spawn().id(); let entity = commands.spawn_empty().id();
let scale = collider_mesh_scale(shape); let scale = collider_mesh_scale(shape);
let mesh = prefab_meshs let mesh = prefab_meshs
@@ -108,7 +108,7 @@ impl EntityWithGraphics {
}; };
let mut entity_commands = commands.entity(entity); let mut entity_commands = commands.entity(entity);
entity_commands.insert_bundle(bundle); entity_commands.insert(bundle);
if sensor { if sensor {
entity_commands.insert(Wireframe); entity_commands.insert(Wireframe);

View File

@@ -97,6 +97,7 @@ bitflags! {
} }
} }
#[derive(Resource)]
pub struct TestbedState { pub struct TestbedState {
pub running: RunMode, pub running: RunMode,
pub draw_colls: bool, pub draw_colls: bool,
@@ -122,6 +123,7 @@ pub struct TestbedState {
camera_locked: bool, // Used so that the camera can remain the same before and after we change backend or press the restart button. camera_locked: bool, // Used so that the camera can remain the same before and after we change backend or press the restart button.
} }
#[derive(Resource)]
struct SceneBuilders(Vec<(&'static str, fn(&mut Testbed))>); struct SceneBuilders(Vec<(&'static str, fn(&mut Testbed))>);
#[cfg(feature = "other-backends")] #[cfg(feature = "other-backends")]
@@ -369,19 +371,22 @@ impl TestbedApp {
"Rapier: 3D demos".to_string() "Rapier: 3D demos".to_string()
}; };
let mut app = App::new(); let window_plugin = WindowPlugin {
window: WindowDescriptor {
app.insert_resource(WindowDescriptor {
title, title,
..Default::default() ..Default::default()
}) },
.insert_resource(ClearColor(Color::rgb(0.15, 0.15, 0.15))) ..Default::default()
};
let mut app = App::new();
app.insert_resource(ClearColor(Color::rgb(0.15, 0.15, 0.15)))
.insert_resource(Msaa { samples: 4 }) .insert_resource(Msaa { samples: 4 })
.insert_resource(AmbientLight { .insert_resource(AmbientLight {
brightness: 0.3, brightness: 0.3,
..Default::default() ..Default::default()
}) })
.add_plugins(DefaultPlugins) .add_plugins(DefaultPlugins.set(window_plugin))
.add_plugin(OrbitCameraPlugin) .add_plugin(OrbitCameraPlugin)
.add_plugin(WireframePlugin) .add_plugin(WireframePlugin)
.add_plugin(bevy_egui::EguiPlugin) .add_plugin(bevy_egui::EguiPlugin)
@@ -995,7 +1000,7 @@ fn draw_contacts(_nf: &NarrowPhase, _colliders: &ColliderSet) {
fn setup_graphics_environment(mut commands: Commands) { fn setup_graphics_environment(mut commands: Commands) {
const HALF_SIZE: f32 = 100.0; const HALF_SIZE: f32 = 100.0;
commands.spawn_bundle(DirectionalLightBundle { commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight { directional_light: DirectionalLight {
illuminance: 10000.0, illuminance: 10000.0,
// Configure the projection to better fit the scene // Configure the projection to better fit the scene
@@ -1020,7 +1025,7 @@ fn setup_graphics_environment(mut commands: Commands) {
}); });
commands commands
.spawn_bundle(Camera3dBundle { .spawn(Camera3dBundle {
transform: Transform::from_matrix( transform: Transform::from_matrix(
Mat4::look_at_rh( Mat4::look_at_rh(
Vec3::new(-30.0, 30.0, 100.0), Vec3::new(-30.0, 30.0, 100.0),
@@ -1053,7 +1058,7 @@ fn setup_graphics_environment(mut commands: Commands) {
// ..Default::default() // ..Default::default()
// }); // });
commands commands
.spawn_bundle(Camera2dBundle { .spawn(Camera2dBundle {
transform: Transform { transform: Transform {
translation: Vec3::new(0.0, 0.0, 0.0), translation: Vec3::new(0.0, 0.0, 0.0),
rotation: Quat::IDENTITY, rotation: Quat::IDENTITY,