Skip to content

Conversation

@Kanabenki
Copy link
Contributor

Objective

Solution

  • Compute AABBs for entities with a Text2DBundle to enable culling them.

text2d example with AABB gizmos on the text entities:

culltext2d-2024-02-02_12.13.02.mp4

Changelog

Added

  • 2D text outside the view are now culled with the calculate_bounds_text2d system adding the necessary AABBs.

@Kanabenki Kanabenki added C-Feature A new feature, making something new possible A-Text Rendering and layout for characters C-Performance A change motivated by improving speed, memory usage or compile times and removed C-Feature A new feature, making something new possible labels Feb 2, 2024
@Kanabenki Kanabenki force-pushed the culling-text2d branch 2 times, most recently from bf105ff to fc7bac5 Compare February 3, 2024 11:56
half_extents,
};
} else {
commands.entity(entity).try_insert(Aabb {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be insert instead since we know that we don't have the component available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't swap to insert here: if the entity is suddenly despawned we don't want a panic.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 29, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 29, 2024
Merged via the queue into bevyengine:main with commit 58ee3e8 Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Text Rendering and layout for characters C-Performance A change motivated by improving speed, memory usage or compile times S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants