Skip to content

Commit 6a26364

Browse files
authored
Fix zero length transform axis having an effect bounding box used for heuristics etc. (#6967)
1 parent 0921009 commit 6a26364

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

crates/viewer/re_space_view_spatial/src/visualizers/transform3d_arrows.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,22 @@ impl VisualizerSystem for Transform3DArrowsVisualizer {
7878
continue;
7979
};
8080

81+
let results = data_result
82+
.latest_at_with_blueprint_resolved_data::<Transform3D>(ctx, &latest_at_query);
83+
let axis_length: f32 = results.get_mono_with_fallback::<AxisLength>().into();
84+
85+
if axis_length == 0.0 {
86+
// Don't draw axis and don't add to the bounding box!
87+
continue;
88+
}
89+
8190
// Only add the center to the bounding box - the lines may be dependent on the bounding box, causing a feedback loop otherwise.
8291
self.0.add_bounding_box(
8392
data_result.entity_path.hash(),
8493
re_math::BoundingBox::ZERO,
8594
world_from_obj,
8695
);
8796

88-
let results = data_result
89-
.latest_at_with_blueprint_resolved_data::<Transform3D>(ctx, &latest_at_query);
90-
let axis_length = results.get_mono_with_fallback::<AxisLength>().into();
91-
9297
add_axis_arrows(
9398
&mut line_builder,
9499
world_from_obj,

0 commit comments

Comments
 (0)