bevy/crates/bevy_gizmos/src
James Liu 54456b7ea6
Make SystemParam::new_archetype and QueryState::new_archetype unsafe functions (#13044)
# Objective
Fix #2128. Both `Query::new_archetype` and `SystemParam::new_archetype`
do not check if the `Archetype` comes from the same World the state is
initialized from. This could result in unsoundness via invalid accesses
if called incorrectly.

## Solution
Make them `unsafe` functions and lift the invariant to the caller. This
also caught one instance of us not validating the World in
`SystemState::update_archetypes_unsafe_world_cell`'s implementation.

---

## Changelog
Changed: `QueryState::new_archetype` is now an unsafe function.
Changed: `SystemParam::new_archetype` is now an unsafe function.

## Migration Guide
`QueryState::new_archetype` and `SystemParam::new_archetype` are now an
unsafe functions that must be sure that the provided `Archetype` is from
the same `World` that the state was initialized from. Callers may need
to add additional assertions or propagate the safety invariant upwards
through the callstack to ensure safety.
2024-04-21 02:49:42 +00:00
..
primitives separating finite and infinite 3d planes (#12426) 2024-04-18 14:13:22 +00:00
aabb.rs Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
arcs.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
arrows.rs Add double end arrow to gizmos (#11890) 2024-04-16 01:34:22 +00:00
circles.rs Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
config.rs Gizmo line styles (#12394) 2024-03-25 19:10:45 +00:00
gizmos.rs Make SystemParam::new_archetype and QueryState::new_archetype unsafe functions (#13044) 2024-04-21 02:49:42 +00:00
grid.rs Gizmo 3d grids (#12430) 2024-03-13 18:51:53 +00:00
lib.rs Fix crates not building individually (#12948) 2024-04-14 00:06:03 +00:00
light.rs Add basic light gizmos (#12228) 2024-03-03 18:50:46 +00:00
line_joints.wgsl Gizmo line joints (#12252) 2024-03-11 19:21:32 +00:00
lines.wgsl Gizmo line styles (#12394) 2024-03-25 19:10:45 +00:00
pipeline_2d.rs Consolidate Render(Ui)Materials(2d) into RenderAssets (#12827) 2024-04-09 13:26:34 +00:00
pipeline_3d.rs Consolidate Render(Ui)Materials(2d) into RenderAssets (#12827) 2024-04-09 13:26:34 +00:00