Skip to content

Refactor animation timers inside pan_orbit_camera - #25489

Merged
cart merged 2 commits into
bevyengine:mainfrom
taishi-sama:pan_orbit_camera_look_to_refactor
Aug 22, 2026
Merged

Refactor animation timers inside pan_orbit_camera#25489
cart merged 2 commits into
bevyengine:mainfrom
taishi-sama:pan_orbit_camera_look_to_refactor

Conversation

@taishi-sama

@taishi-sama taishi-sama commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Closes #25469

Objective

Upstreamed version uses global Instant::now() for timekeeping for some animations.

Replace that logic with Res<Time<Real>> and Timer

@taishi-sama taishi-sama added A-Camera User-facing camera APIs and controllers. S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 20, 2026
@taishi-sama
taishi-sama marked this pull request as ready for review August 20, 2026 17:04
@taishi-sama taishi-sama changed the title Refactor timers inside pan_orbit_camera Refactor animation timers inside pan_orbit_camera Aug 20, 2026
)>,
mut event: MessageWriter<RequestRedraw>,
time: Res<Time>,
time: Res<Time<Real>>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely correct, and worth doing regardless of what else we decide.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, this was my feedback on the first PR!

@alice-i-cecile alice-i-cecile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that was a nicer cleanup than I anticipated. I prefer this: random Instant::now calls are less idiomatic when we have no reason to use them. We're not even getting more input-aligned time stamps.

@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Aug 20, 2026

@jbuehler23 jbuehler23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, this is a step in the right direction and actually closer aligned to how we have built the editor camera for jackdaw too once exploring bevy_editor_cam

)>,
mut event: MessageWriter<RequestRedraw>,
time: Res<Time>,
time: Res<Time<Real>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, this was my feedback on the first PR!

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 20, 2026

@laundmo laundmo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. At some point we should consider if something like a camera LookTo animation should be using the animation system, but this PR isn't the place to discuss that.

@cart
cart added this pull request to the merge queue Aug 22, 2026
Merged via the queue into bevyengine:main with commit 3190d04 Aug 22, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Camera User-facing camera APIs and controllers. C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor look_to extension of pan_orbit_camera to use Time<Real> and Timer

6 participants