habitacle

This commit is contained in:
Jérôme Bousquié
2026-08-11 21:06:41 +02:00
parent b69c512261
commit 9743cf632e
+18 -10
View File
@@ -38,16 +38,24 @@ fn setup(
Transform::default(),
));
// ajout véhicule
commands.spawn((
Vehicle {
speed: 5.0,
velocity: Vec3::ZERO,
angle: 0.0,
},
Mesh3d(meshes.add(Cuboid::new(1.0, 0.5, 2.0))),
MeshMaterial3d(materials.add(Color::srgb(0.8, 0.2, 0.2))),
Transform::from_xyz(0.0, 0.25, 0.0),
));
commands
.spawn((
Vehicle {
speed: 5.0,
velocity: Vec3::ZERO,
angle: 0.0,
},
Mesh3d(meshes.add(Cuboid::new(1.0, 0.5, 2.0))),
MeshMaterial3d(materials.add(Color::srgb(0.8, 0.2, 0.2))),
Transform::from_xyz(0.0, 0.25, 0.0),
))
.with_children(|parent| {
parent.spawn((
Mesh3d(meshes.add(Cuboid::new(1.0, 0.4, 1.0))),
MeshMaterial3d(materials.add(Color::srgb(0.2, 0.2, 0.8))),
Transform::from_xyz(0.0, 0.45, 0.3),
));
});
}
fn move_vehicle(