Skip to content

Commit

Permalink
update transform3d partial updates cpp example
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jan 17, 2025
1 parent 18047f6 commit 7b90cee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
9 changes: 3 additions & 6 deletions docs/snippets/all/archetypes/transform3d_partial_updates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ int main() {
// Update only the rotation of the box.
for (int deg = 0; deg <= 45; deg++) {
auto rad = truncated_radians(deg * 4);
// TODO(#8583): update_fields
rec.log(
"box",
rerun::Transform3D().with_rotation_axis_angle(
rerun::Transform3D::update_fields().with_rotation_axis_angle(
rerun::RotationAxisAngle({0.0f, 1.0f, 0.0f}, rerun::Angle::radians(rad))
)
);
Expand All @@ -42,16 +41,14 @@ int main() {
// Update only the rotation of the box.
for (int deg = 0; deg <= 45; deg++) {
auto rad = truncated_radians((deg + 45) * 4);
// TODO(#8583): update_fields
rec.log(
"box",
rerun::Transform3D().with_rotation_axis_angle(
rerun::Transform3D::update_fields().with_rotation_axis_angle(
rerun::RotationAxisAngle({0.0f, 1.0f, 0.0f}, rerun::Angle::radians(rad))
)
);
}

// Clear all of the box's attributes, and reset its axis length.
// TODO(#8583): clear_fields
rec.log("box", rerun::Transform3D().with_axis_length(15.0));
rec.log("box", rerun::Transform3D::clear_fields().with_axis_length(15.0));
}
16 changes: 3 additions & 13 deletions docs/snippets/snippets.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,16 @@

# These archetypes will ignore the associated snippets in the snippet index.
[snippets_ref.archetypes.opt_out]
"DataframeQuery" = [
"reference/dataframe_save_blueprint"
]
"DataframeQuery" = ["reference/dataframe_save_blueprint"]

# These components will ignore the associated snippets in the snippet index.
[snippets_ref.components.opt_out]
"ShowLabels" = [
"tutorials/data_out",
]
"ShowLabels" = ["tutorials/data_out"]

# These arbitrary feature names will be indexed exactly as written down.
# Add anything you can think about!
[snippets_ref.features]
"Dataframes" = [
"reference/dataframe_query",
"reference/dataframe_view_query",
]
"Dataframes" = ["reference/dataframe_query", "reference/dataframe_view_query"]
"`AnyValue`" = [
"tutorials/any_values",
"tutorials/extra_values",
Expand Down Expand Up @@ -271,9 +264,6 @@ quick_start = [ # These examples don't have exactly the same implementation.
"archetypes/transform3d_hierarchy" = [ # Uses a lot of trigonometry which is surprisingly easy to get the same on Rust & C++, but not on Python/Numpy
"py",
]
"archetypes/transform3d_partial_updates" = [
"cpp", # TODO(#8583): remove once C++ partial updates APIs have shipped
]
"archetypes/instance_poses3d_combined" = [ # TODO(#3235): Slight floating point differences in point grid.
"cpp",
"py",
Expand Down

0 comments on commit 7b90cee

Please sign in to comment.