bevy/examples/3d/load_gltf.rs
Cameron Hart f61e44db28 Update glam to 0.13.0. (#1550)
See https://github.com/bitshifter/glam-rs/blob/master/CHANGELOG.md for details on changes.

Co-authored-by: Cameron Hart <c_hart@wargaming.net>
2021-03-06 19:39:16 +00:00

23 lines
708 B
Rust

use bevy::prelude::*;
fn main() {
App::build()
.insert_resource(Msaa { samples: 4 })
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands
.spawn_scene(asset_server.load("models/FlightHelmet/FlightHelmet.gltf#Scene0"))
.spawn(LightBundle {
transform: Transform::from_xyz(4.0, 5.0, 4.0),
..Default::default()
})
.spawn(PerspectiveCameraBundle {
transform: Transform::from_xyz(0.7, 0.7, 1.0)
.looking_at(Vec3::new(0.0, 0.3, 0.0), Vec3::Y),
..Default::default()
});
}