-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What * Part of #6831 * Replacement for #6988 Introduces a new `LeafTransform3D` archetype that is always applicable. It entails a copy of all of `Transform3D`'s components - axis length and transform relation have been omitted so far. Surprisingly, I didn't have much need for the extensive extensions we have on `Transform3D` so far: Leaf transform is much less commonly used and deals with arrays, making it sufficiently different from `Transform3D`. Also a lot of the extensions associated with `Transform3D` are there for legacy reasons - with the new more componetized interface we get much more reasonable ergonomics out of the box! This PR entails a major overhaul of the `TransformContext`. For *sure* not the last time we do this (looking at you 2D transform handling & not-so-great 2D<->3D interactions!), but the intention is to be a bit more forward looking and to enforce use of leaf transforms everywhere. Single component leaf transforms are supported everywhere now. Multi component leaf transforms logs a warning for all visualizers except Mesh3D and Asset3D where it bottoms out in instantiating the mesh multiple times: https://github.com/user-attachments/assets/62d26661-cd8c-4b4a-b912-063ef60e063a Snippet demonstrating combination of `Transform3D` with `LeafTransforms3D`: https://github.com/user-attachments/assets/ebb2ce5b-6d9a-407d-9f21-57b92f4ac25c Follow-up PRs will improve the interaction of various archetypes with `LeafTransforms3D` as well as remove now unused legacy types. ### Checklist * [x] run main ci to ensure that roundtrip & snippet tests are passing * [x] check transform checklist again! * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7015?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7015?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/7015) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
- Loading branch information
Showing
141 changed files
with
3,863 additions
and
1,054 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
43 changes: 43 additions & 0 deletions
43
crates/store/re_types/definitions/rerun/archetypes/leaf_transforms3d.fbs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace rerun.archetypes; | ||
|
||
|
||
/// One or more transforms between the parent and the current entity which are *not* propagated in the transform hierarchy. | ||
/// | ||
/// For transforms that are propagated in the transform hierarchy, see [archetypes.Transform3D]. | ||
/// | ||
/// If both [archetypes.LeafTransforms3D] and [archetypes.Transform3D] are present, | ||
/// first the tree propagating [archetypes.Transform3D] is applied, then [archetypes.LeafTransforms3D]. | ||
/// | ||
/// Currently, most visualizers support only a single leaf transform per entity. | ||
/// Check archetype documentations for details - if not otherwise specified, only the first leaf transform is applied. | ||
/// | ||
/// From the point of view of the entity's coordinate system, | ||
/// all components are applied in the inverse order they are listed here. | ||
/// E.g. if both a translation and a max3x3 transform are present, | ||
/// the 3x3 matrix is applied first, followed by the translation. | ||
/// | ||
/// \example archetypes/leaf_transforms3d_combined title="Regular & leaf transform in tandom" image="https://static.rerun.io/leaf_transform3d/41674f0082d6de489f8a1cd1583f60f6b5820ddf/1200w.png" | ||
table LeafTransforms3D ( | ||
"attr.rust.derive": "Default, PartialEq", | ||
"attr.rust.generate_field_info", | ||
"attr.docs.category": "Spatial 3D", | ||
"attr.docs.view_types": "Spatial3DView, Spatial2DView: if logged above active projection" | ||
) { | ||
/// Translation vectors. | ||
translations: [rerun.components.LeafTranslation3D] ("attr.rerun.component_optional", nullable, order: 1100); | ||
|
||
/// Rotations via axis + angle. | ||
rotation_axis_angles: [rerun.components.LeafRotationAxisAngle] ("attr.rerun.component_optional", nullable, order: 1200); | ||
|
||
/// Rotations via quaternion. | ||
quaternions: [rerun.components.LeafRotationQuat] ("attr.rerun.component_optional", nullable, order: 1300); | ||
|
||
/// Scaling factors. | ||
scales: [rerun.components.LeafScale3D] ("attr.rerun.component_optional", nullable, order: 1400); | ||
|
||
/// 3x3 transformation matrices. | ||
mat3x3: [rerun.components.LeafTransformMat3x3] ("attr.rerun.component_optional", nullable, order: 1500); | ||
|
||
// TODO(andreas): Support TransformRelation? | ||
// TODO(andreas): Support axis_length? | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
crates/store/re_types/definitions/rerun/components/out_of_tree_transform3d.fbs
This file was deleted.
Oops, something went wrong.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.