-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High-level fj-viewer interface #803
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d475bd2
High-level fj-viewer events
jeevcat 4ff534c
Remove unneeded code
jeevcat 19aa5e6
Split event handling into window and input
jeevcat 8e797dc
Merge branch 'main' into sam/viewer-interface
jeevcat 9a4f94d
Ensure same focus point behavior
jeevcat 99978cf
Remove Actions
jeevcat c177f88
Clearer separation between event types
jeevcat 7363ab9
Rename events using model manipulation metaphor
jeevcat 9db1be4
Extract and document rotation constant
jeevcat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metaphor that Fornjot's UI follows, is that you manipulate the model, not an abstract camera. So maybe
Translate
andRotate
would be better names thanPan
/Orbit
.I realize that this metaphor isn't fully followed everywhere, especially in code comments. So there's no need to follow it here right now, and I certainly won't block merging this pull request on this detail. I'm just mentioning it, in case you have thoughts, and to document where I'd like to see things go mid- to long-term.
(Side note: Maybe we should rename
Camera
toObserver
orSpectator
to reinforce the metaphor and reduce confusion. Maybe not a good idea.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'll fix this up.
On a related note. I feel like the camera object shouldn't exist in
fj-window
at all. Seems like it belongs infj-viewer
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already lives in
fj-viewer
: https://github.com/hannobraun/Fornjot/blob/main/crates/fj-viewer/src/camera.rsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I guess I mean the lifetime could also be controlled by the viewer. Right now it is instantiated in
fj-window
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense. The way all of this is structured pretty much reflects the fact, that it lived in a single crate not long ago. It probably makes sense to have a single
Viewer
struct with methods likehandle_input
anddraw_graphics
. No need, really, forfj-window
to deal withinput::Handler
,Renderer
, etc. separately.