mgd2-tram-championships/src/game/scene.rs

26 lines
610 B
Rust
Raw Normal View History

use bevy::prelude::*;
use crate::cleanup;
const NORMALSPUR: f32 = 1.435;
pub fn setup(
mut c: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
// spawn in floor plane
c.spawn((
Mesh3d(meshes.add(Plane3d::default().mesh().size(128., 128.))),
MeshMaterial3d(materials.add(Color::srgb(0.3, 0.8, 0.4))),
cleanup::Scene,
));
// track (temporary)
c.spawn((
Mesh3d(meshes.add(Cuboid::new(NORMALSPUR, 0.25, 96.))),
MeshMaterial3d(materials.add(Color::BLACK)),
cleanup::Scene,
));
}