mirror of
https://codeberg.org/schrottkatze/mgd2-tram-championships.git
synced 2025-07-02 09:37:40 +00:00
start map stuff
This commit is contained in:
parent
684fdd5558
commit
67383ac1db
8 changed files with 476 additions and 123 deletions
|
@ -3,26 +3,19 @@ use bevy_third_person_camera::ThirdPersonCameraTarget;
|
|||
|
||||
use crate::cleanup;
|
||||
|
||||
const NORMALSPUR: f32 = 1.435;
|
||||
|
||||
pub fn setup(
|
||||
mut c: Commands,
|
||||
asset_server: Res<AssetServer>,
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||
) {
|
||||
// spawn in floor plane
|
||||
let scene_handle = asset_server.load(GltfAssetLabel::Scene(0).from_asset("gltf/test.glb"));
|
||||
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.))),
|
||||
Mesh3d(meshes.add(Cuboid::new(1., 1., 1.))),
|
||||
MeshMaterial3d(materials.add(Color::BLACK)),
|
||||
ThirdPersonCameraTarget,
|
||||
cleanup::Scene,
|
||||
));
|
||||
c.spawn(SceneRoot(scene_handle));
|
||||
info!("Scene spawned!")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue