bevy/examples/3d
Cameron 7989cb2650 Add global time scaling (#5752)
# Objective

- Make `Time` API more consistent.
- Support time accel/decel/pause.

## Solution

This is just the `Time` half of #3002. I was told that part isn't controversial.

- Give the "delta time" and "total elapsed time" methods `f32`, `f64`, and `Duration` variants with consistent naming.
- Implement accelerating / decelerating the passage of time.
- Implement stopping time.

---

## Changelog

- Changed `time_since_startup` to `elapsed` because `time.time_*` is just silly.
- Added `relative_speed` and `set_relative_speed` methods.
- Added `is_paused`, `pause`, `unpause` , and methods. (I'd prefer `resume`, but `unpause` matches `Timer` API.)
- Added `raw_*` variants of the "delta time" and "total elapsed time" methods.
- Added `first_update` method because there's a non-zero duration between startup and the first update.

## Migration Guide

- `time.time_since_startup()` -> `time.elapsed()`
- `time.seconds_since_startup()` -> `time.elapsed_seconds_f64()`
- `time.seconds_since_startup_wrapped_f32()` -> `time.elapsed_seconds_wrapped()`

If you aren't sure which to use, most systems should continue to use "scaled" time (e.g. `time.delta_seconds()`). The realtime "unscaled" time measurements (e.g. `time.raw_delta_seconds()`) are mostly for debugging and profiling.
2022-10-22 18:52:29 +00:00
..
3d_scene.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
3d_shapes.rs Rename shapes examples for consistency (#6082) 2022-09-25 00:57:07 +00:00
lighting.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
lines.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
load_gltf.rs Add global time scaling (#5752) 2022-10-22 18:52:29 +00:00
msaa.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
orthographic.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
parenting.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
pbr.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
render_to_texture.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
shadow_biases.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
shadow_caster_receiver.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
skybox.rs Add global time scaling (#5752) 2022-10-22 18:52:29 +00:00
spherical_area_lights.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
split_screen.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
spotlight.rs Add global time scaling (#5752) 2022-10-22 18:52:29 +00:00
texture.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
transparency_3d.rs Add global time scaling (#5752) 2022-10-22 18:52:29 +00:00
two_passes.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
update_gltf_scene.rs Add global time scaling (#5752) 2022-10-22 18:52:29 +00:00
vertex_colors.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
wireframe.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00