Headless mode Orbit (#66)

This commit is contained in:
Brooks Palin
2024-02-29 22:20:32 -07:00
committed by GitHub
parent a2b2946678
commit 5cb23f0607
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -97,7 +97,7 @@ fn main() {
);
if orbit {
app.insert_resource(OrbitSettings { radius: 10.0 })
app.insert_resource(OrbitSettings { radius: 5.0 })
.add_systems(Update, orbit_scene);
}
@@ -164,7 +164,7 @@ struct OrbitSettings {
}
fn orbit_scene(
mut camera: Query<&mut Transform, With<PrimaryWindow>>,
mut camera: Query<&mut Transform, With<Camera>>,
orbit_settings: Res<OrbitSettings>,
time: Res<Time>,
) {
@@ -173,9 +173,9 @@ fn orbit_scene(
};
main_cam_transform.translation = Vec3::new(
orbit_settings.radius * time.elapsed_seconds().cos() * 10.0,
orbit_settings.radius * time.elapsed_seconds().sin(),
orbit_settings.radius * time.elapsed_seconds().cos(),
6.0,
orbit_settings.radius * time.elapsed_seconds().sin(),
);
main_cam_transform.look_at(Vec3::ZERO, Vec3::Y);
}
+2 -2
View File
@@ -147,7 +147,7 @@ fn extract_screen_capture_components(
) {
for (entity, screen_capture) in screen_capure_comps.iter() {
if screen_capture.should_capture() {
println!(
info!(
"Capturing Frame: {} / {}",
screen_capture.frames, screen_capture.max_frames
);
@@ -275,7 +275,7 @@ fn save_buffer_to_file(
.expect("Output path could not be created");
let path = format!(
"{}img_{:0.5}.png",
"{}img_{:0>4}.png",
screen_capture.to_directory, screen_capture.frames
);