Skip to content

fix: increase Field of View slider precision in view panel#902

Open
mvanhorn wants to merge 1 commit into
playcanvas:mainfrom
mvanhorn:fix/fov-slider-precision
Open

fix: increase Field of View slider precision in view panel#902
mvanhorn wants to merge 1 commit into
playcanvas:mainfrom
mvanhorn:fix/fov-slider-precision

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

Increases the FoV SliderInput precision in the view panel from 1 to 2 decimals so animated FoV reads back at ~0.01-degree resolution instead of ~0.1-degree.

Why this matters

In #862 the reporter showed that animated FoV in a Bezier curve looked choppy because the FoV slider rounds the recorded value to one decimal. FoV flows from the view-panel slider through the camera.setFov event and is stored verbatim in camera-pose keyframes (src/camera-poses.ts), so widening the slider's rounding is sufficient to fix the keyframe resolution without changing the animation pipeline.

Testing

  • src/ui/view-panel.ts line 153: precision: 1 -> precision: 2. Slider min/max (10/120) unchanged.
  • npm run lint clean.
  • tsc --noEmit clean.
  • The companion FoV sliders in publish-settings-dialog.ts and export-popup.ts are intentionally left at precision: 0 - those configure static exports, not live edits captured in keyframes.

Fixes #862

The FoV slider in the view panel rounded to one decimal place. Camera-pose
keyframes store the slider's value verbatim, so animated FoV in a Bezier
curve looked choppy at ~0.1 degree resolution.

Raising the SliderInput precision from 1 to 2 gives the user ~0.01 degree
control without touching the event bus or keyframe storage (FoV is already
a plain number with no intermediate rounding). The static-export FoV
sliders in publish-settings-dialog.ts and export-popup.ts intentionally
remain at integer resolution since they do not record keyframes.

Refs playcanvas#862

Copilot AI 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.

Pull request overview

Increases FoV slider precision from 1 to 2 decimals in the view panel so animated FoV keyframes capture finer values, addressing choppy Bezier-animated FoV reported in #862.

Changes:

  • Bump precision from 1 to 2 on the FoV SliderInput in the view panel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The Field of View parameter should have a higher resolution.

3 participants