0.3
Bevy version
- Bump to bevy
0.11
New in 0.3
This is decently sized release with quite a few new things.
- New
ControlFlow
variant:Probe
. - ZSTs for relations are now enforced at compile time.
---- src/lib.rs - (line 20) stdout ---- error[E0080]: evaluation of `<Likes as aery::relation::ZstOrPanic>::ZST_OR_PANIC` failed --> /home/yogii/Repos/aery/src/relation.rs:142:13 | 142 | panic!("Not a ZST") | ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Not a ZST', /home/yogii/Repos/aery/src/relation.rs:142:13 | = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant used --> src/lib.rs:47:10 | 29 | #[derive(Relation)] | ^^^^^^^^ |
- New
Scope
API to spawn and manipulate hierarchies.wrld.spawn(A) .scope::<R>(|_, mut ent| { ent.insert(B); ent.scope::<R>(|_, mut ent| { ent.insert(C); }); });
- Symmetric Relations.
#[derive(Relation)] #[symmetric] struct R;
- Relation events for target changes and entity cleanup.
fn sys(mut events: EventReader<TargetEvent>) { for e in events.iter() { // Did some entity set an `R` to some other entity? if e.matches(Wc, TargetOp::Set, R, Wc) { // .. } } }
- Hierarchy ascent is now supported along side the existing descent.
fn sys(query: Query<(A, Relations<R>)>, roots: Query<Entity, Root<R>>) { query.ops().traverse_targets::<R>().for_each(|a, a_ancestor| { // .. }) }
Breaking
- Module restructures if you're not using
prelude
. .breadth_first::<R>(roots)
->.traverse::<R>(roots)
- Recursive cleanup no longer triggers when unsetting. This never made sense.
RelationCommands
reworked and no longer implemented forCommands
andWorld
. New implementation is forEntityMut<'_>
with a new API.
Misc
- Many doc improvements & with illustrations in documentation with aquamarine.