Skip to content

Commit a35edd0

Browse files
committed
Include camera origin in view bounds
1 parent e021608 commit a35edd0

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

crates/re_space_view_spatial/src/parts/cameras.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl CamerasPart {
8585
// There's one wrinkle with using the parent transform though:
8686
// The entity itself may have a 3D transform which (by convention!) we apply *before* the pinhole camera.
8787
// Let's add that if it exists.
88-
if let Some(transform_at_entity) = transform_at_entity {
88+
if let Some(transform_at_entity) = transform_at_entity.clone() {
8989
world_from_camera =
9090
world_from_camera * transform_at_entity.into_parent_from_child_transform();
9191
}
@@ -171,6 +171,13 @@ impl CamerasPart {
171171
if let Some(outline_mask_ids) = entity_highlight.instances.get(&instance_key) {
172172
lines.outline_mask_ids(*outline_mask_ids);
173173
}
174+
175+
self.data.extend_bounding_box_with_points(
176+
std::iter::once(glam::Vec3::ZERO),
177+
transform_at_entity
178+
.unwrap_or(Transform3D::IDENTITY)
179+
.into_parent_from_child_transform(),
180+
);
174181
}
175182
}
176183

0 commit comments

Comments
 (0)