Skip to content

Commit

Permalink
cache transform arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Feb 22, 2024
1 parent e2826e1 commit af01b28
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions crates/re_space_view_spatial/src/visualizers/transform3d_arrows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ impl VisualizerSystem for Transform3DArrowsVisualizer {
) -> Result<Vec<re_renderer::QueueableDrawData>, SpaceViewSystemExecutionError> {
let transforms = view_ctx.get::<TransformContext>()?;

let query_caches = ctx.entity_db.query_caches();
let store = ctx.entity_db.store();

let latest_at_query = re_data_store::LatestAtQuery::new(query.timeline, query.latest_at);

// Counting all transforms ahead of time is a bit wasteful, but we also don't expect a huge amount,
Expand All @@ -60,14 +62,19 @@ impl VisualizerSystem for Transform3DArrowsVisualizer {
line_builder.radius_boost_in_ui_points_for_outlines(SIZE_BOOST_IN_POINTS_FOR_LINE_OUTLINES);

for data_result in query.iter_visible_data_results(Self::identifier()) {
if store
.query_latest_component::<Transform3D>(&data_result.entity_path, &latest_at_query)
.is_none()
{
if !*data_result.accumulated_properties().transform_3d_visible {
continue;
}

if !*data_result.accumulated_properties().transform_3d_visible {
if query_caches
.query_archetype_pov1::<re_types::archetypes::Transform3D, Transform3D, _>(
store,
&latest_at_query.clone().into(),
&data_result.entity_path,
|_| {},
)
.is_err()
{
continue;
}

Expand Down

0 comments on commit af01b28

Please sign in to comment.