tinkering around with bevy

This commit is contained in:
Hartmut Seichter 2022-08-07 22:26:12 +02:00
parent 52bb4d43df
commit c33335fc50
5 changed files with 450 additions and 492 deletions

View file

@ -21,11 +21,19 @@ struct Position { x: f32, y: f32 }
fn build_scene(mut commands: Commands) {
commands.spawn()
.insert(Person)
.insert(Position{ x: 10.0, y: 10.0 });
.insert(Position { x: 10.0, y: 10.0 } );
// camera
// commands.spawn_bundle(OffAxisProjection {
// transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
// ..default()
// });
}
fn print_positions(query : Query<&Position>) {
for position in query.iter() {
println!("position {:?} {:?}", position.x, position.y)
// println!("position {:?} {:?}", position.x, position.y)
}
}