diff options
| author | Thierry Berger <contact@thierryberger.com> | 2024-09-06 16:15:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-06 16:15:34 +0200 |
| commit | 04058a111dcb99393e52158823c0f7d6a87407fb (patch) | |
| tree | d14e4ff81f92fe7643114a515b19078232191e03 /src_testbed/objects | |
| parent | bedb12b88a4ad2cc8bf665a66c76a30654bddc11 (diff) | |
| download | rapier-04058a111dcb99393e52158823c0f7d6a87407fb.tar.gz rapier-04058a111dcb99393e52158823c0f7d6a87407fb.tar.bz2 rapier-04058a111dcb99393e52158823c0f7d6a87407fb.zip | |
update testbeds to bevy 0.14 (#723)
Diffstat (limited to 'src_testbed/objects')
| -rw-r--r-- | src_testbed/objects/node.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src_testbed/objects/node.rs b/src_testbed/objects/node.rs index 58e3a00..a5f7d51 100644 --- a/src_testbed/objects/node.rs +++ b/src_testbed/objects/node.rs @@ -44,7 +44,7 @@ impl EntityWithGraphics { #[cfg(feature = "dim2")] let selection_material = ColorMaterial { - color: Color::rgb(1.0, 0.0, 0.0), + color: Color::from(Srgba::rgb(1.0, 0.0, 0.0)), texture: None, }; #[cfg(feature = "dim3")] @@ -52,7 +52,7 @@ impl EntityWithGraphics { metallic: 0.5, perceptual_roughness: 0.5, double_sided: true, // TODO: this doesn't do anything? - ..StandardMaterial::from(Color::rgb(1.0, 0.0, 0.0)) + ..StandardMaterial::from(Color::from(Srgba::rgb(1.0, 0.0, 0.0))) }; instanced_materials.insert( @@ -85,7 +85,7 @@ impl EntityWithGraphics { .or_else(|| generate_collider_mesh(shape).map(|m| meshes.add(m))); let opacity = 1.0; - let bevy_color = Color::rgba(color.x, color.y, color.z, opacity); + let bevy_color = Color::from(Srgba::new(color.x, color.y, color.z, opacity)); let shape_pos = collider_pos * delta; let mut transform = Transform::from_scale(scale); transform.translation.x = shape_pos.translation.vector.x as f32; @@ -169,11 +169,12 @@ impl EntityWithGraphics { if let Some(material) = materials.get_mut(&self.material) { #[cfg(feature = "dim2")] { - material.color = Color::rgba(color.x, color.y, color.z, self.opacity); + material.color = Color::from(Srgba::new(color.x, color.y, color.z, self.opacity)); } #[cfg(feature = "dim3")] { - material.base_color = Color::rgba(color.x, color.y, color.z, self.opacity); + material.base_color = + Color::from(Srgba::new(color.x, color.y, color.z, self.opacity)); } } self.color = color; |
