Skip to content

fix(Camera): fix setDirectionOfProjection on a new camera - #3759

Merged
finetjul merged 1 commit into
Kitware:masterfrom
daker:fix-camera
Nov 17, 2026
Merged

finetjul merged 1 commit into
Kitware:masterfrom
daker:fix-camera

Conversation

@daker

@daker daker commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Context

setDirectionOfProjection changed the direction, the focal point and the view plane normal, but did not call modified(). Objects that monitor the camera MTime continued to use the old view. The setter now calls modified() and returns true when the direction changes. It returns false when the direction is the same.

The default values have no distance. On a new camera, the setter calculated the focal point with an undefined distance, and the focal point became NaN. If the initial values have no distance, the constructor now calculates it from the position and the focal point. The direction of projection and the view plane normal keep their initial values.

Fixes #3744
Fixes #3746

Results

Changes

PR Checklist

  • GitHub Actions CI passed: semantic-release commit messages, lint, and tests
  • Test coverage added
  • Documentation and TypeScript definitions are updated to match these changes

Comment thread Sources/Rendering/Core/Camera/index.js Resolved
Comment thread Sources/Rendering/Core/Camera/index.js Resolved
@daker
daker force-pushed the fix-camera branch 2 times, most recently from 824b502 to ca65cc5 Compare November 16, 2026 16:03
setDirectionOfProjection changed the direction, the focal point and
the view plane normal, but did not call modified(). Objects that
monitor the camera MTime continued to use the old view. The setter
now calls modified() and returns true when the direction changes.
It returns false when the direction is the same.

The default values have no distance. On a new camera, the setter
calculated the focal point with an undefined distance, and the focal
point became NaN. If the initial values have no distance, the
constructor now calculates it from the position and the focal point.
The direction of projection and the view plane normal keep their
initial values.

Fixes Kitware#3744
Fixes Kitware#3746

@finetjul finetjul 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

@finetjul
finetjul added this pull request to the merge queue Nov 17, 2026
Merged via the queue into Kitware:master with commit 2288312 Nov 17, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 38.0.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Automated label label Nov 17, 2026
@daker
daker deleted the fix-camera branch November 17, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Automated label

Projects

None yet

2 participants