mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-29 09:08:58 +00:00
orbit works
This commit is contained in:
@@ -95,9 +95,9 @@ fn main() {
|
|||||||
frames,
|
frames,
|
||||||
output_res,
|
output_res,
|
||||||
);
|
);
|
||||||
|
|
||||||
if orbit {
|
if orbit {
|
||||||
app.insert_resource(OrbitSettings { radius: 10.0 })
|
app.insert_resource(OrbitSettings { radius: 5.0 })
|
||||||
.add_systems(Update, orbit_scene);
|
.add_systems(Update, orbit_scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ struct OrbitSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn orbit_scene(
|
fn orbit_scene(
|
||||||
mut camera: Query<&mut Transform, With<PrimaryWindow>>,
|
mut camera: Query<&mut Transform, With<Camera>>,
|
||||||
orbit_settings: Res<OrbitSettings>,
|
orbit_settings: Res<OrbitSettings>,
|
||||||
time: Res<Time>,
|
time: Res<Time>,
|
||||||
) {
|
) {
|
||||||
@@ -173,9 +173,9 @@ fn orbit_scene(
|
|||||||
};
|
};
|
||||||
|
|
||||||
main_cam_transform.translation = Vec3::new(
|
main_cam_transform.translation = Vec3::new(
|
||||||
orbit_settings.radius * time.elapsed_seconds().cos() * 10.0,
|
orbit_settings.radius * time.elapsed_seconds().cos(),
|
||||||
orbit_settings.radius * time.elapsed_seconds().sin(),
|
|
||||||
6.0,
|
6.0,
|
||||||
|
orbit_settings.radius * time.elapsed_seconds().sin(),
|
||||||
);
|
);
|
||||||
main_cam_transform.look_at(Vec3::ZERO, Vec3::Y);
|
main_cam_transform.look_at(Vec3::ZERO, Vec3::Y);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ fn extract_screen_capture_components(
|
|||||||
) {
|
) {
|
||||||
for (entity, screen_capture) in screen_capure_comps.iter() {
|
for (entity, screen_capture) in screen_capure_comps.iter() {
|
||||||
if screen_capture.should_capture() {
|
if screen_capture.should_capture() {
|
||||||
println!(
|
info!(
|
||||||
"Capturing Frame: {} / {}",
|
"Capturing Frame: {} / {}",
|
||||||
screen_capture.frames, screen_capture.max_frames
|
screen_capture.frames, screen_capture.max_frames
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user