File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
release-content/migration-guides Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ title : Automatic `Aabb` updates for sprites and meshes
3+ pull_requests : [18742]
4+ ---
5+
6+ Bevy automatically creates an ` Aabb ` component for entities containing a mesh
7+ or sprite - the ` Aabb ` is then used for visibility and picking.
8+
9+ In 0.17 the ` Aabb ` [ was not updated] ( https://github.com/bevyengine/bevy/issues/4294 )
10+ if the mesh or sprite was modified. This has been fixed in 0.18. If you were working around the issue by manually updating or removing the
11+ ` Aabb ` , then the workaround is no longer needed.
12+
13+ ``` rust
14+ // 0.17: Modify the mesh, and remove the `Aabb` so that it's automatically
15+ // recreated from the modified mesh.
16+ mesh . insert_attribute (Mesh :: ATTRIBUTE_POSITION , new_positions );
17+ entity . remove :: <Aabb >();
18+
19+ // 0.18: The `Aabb` will be automatically updated.
20+ mesh . insert_attribute (Mesh :: ATTRIBUTE_POSITION , new_positions );
21+ ```
22+
23+ For users who want more control, 0.18 also adds a ` NoAutoAabb ` component. This
24+ will disable both automatic creation and automatic update of ` Aabb ` components.
25+
26+ ``` rust
27+ entity . insert (NoAutoAabb );
28+ ```
You can’t perform that action at this time.
0 commit comments