-
Notifications
You must be signed in to change notification settings - Fork 269
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
Improve the heuristic for the camera projection distance #916
Conversation
Base in on the latest known scene size.
@@ -107,6 +115,7 @@ impl Viewport { | |||
spaces_info, | |||
space_info, | |||
&ObjectsProperties::default(), | |||
&macaw::BoundingBox::nothing(), |
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.
I don't like how I need to do this either. Why do we need the TransformCache
when creating a SpaceView
?
default_queried_objects_by_category
uses it for objects_with_reachable_transform
which only uses the graph part of it, not the actual transforms.
But it is also used to populate the initial cached_transforms
, but cached_transforms
is already recomputed at the start of each frame, so I don't see the need for it at all (or it could be an Option
so we don't need to populate it with a dummy-value on start, or we could populate it with Default
).
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.
Don't like it either! The more accurate line of reasoning is afaik that we populate a scene and populating a scene requires transforms.
Relatedly I'd like to either get rid of SpaceInfo altogether or at least make it derived of the transform cache and not the other way round. SpaceInfo as a concept is rather odd both in naming and role - really what it digests for us is "all paths that have a transform and how they relate to all other paths"
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.
fixing some aspects of this now while fixing space view generation heuristics
The way out of passing around things for heuristics would be to have all elements on
We could then update all autovalues whenever we do the propagation |
That could work, but takes a bit of care. We would need to update the object properties at the start of each frame, and make sure at least the root objects have properties (or that they all do). |
Closed by #1433 |
Base in on the latest known scene size.
Closes #681
I'm not super-happy with how we need to pipe the scene bbox around to accomplish this.
An alternative would be to computer it last, that is: populate the scene with a dummy distance, then compute the final distance after the scene is complete, like we do for point radii. The problem with this is that we also need the projection distance for the transform hieararchy for projecting 2D stuff onto the plane.
Checklist
CHANGELOG.md
(if this is a big enough change to warrant it)