Releases: iiYese/aery
Releases · iiYese/aery
0.7
- Updated to bevy
0.14
- Aery can now be reflect thanks to hooks allowing for serialization & use in scenes.
- Removed
TargetEvent
&CleanupEvent
: Superseded by hooks & observers. AddedSetEvent
&UnsetEvent
triggers. - Remove
checked_despawn
cleanup now uses hooks & regular despawn meaning:- You don't have to remember to call a different function.
- Better compatibility with hierarchy (
despawn_recursive
also triggers arey cleanup). - You don't have to worry about reminding users to call a different function if you're crate author looking to use arey as a dependency.
0.6.0
0.5.2
0.5.1
0.5
- Update to bevy 0.12.
- Add missing docs for
Scope
. Scope
now works withCommands
and does not require a&mut World
.- Added partial
bevy_hierarchy
compatibility. All of the query APIs can be used to perform operations withbevy_hierarchy
edges.
fn sys(
query: Query<(&C, Relations<Hierarchy>)>,
roots: Query<Entity, (With<Children>, Without<Parent>)>
) {
query.traverse::<Hierarchy>(roots.iter()).for_each(|c, _| {
// ..
})
}
0.4
- New filters for relations:
Abstains
,Branch
,Leaf
. - Internals completely reworked for better performance & memory footprint (
SmallVec
s like bevy_hierarchy now). - New
Track
API to track the last seen item from a query when traversing an edge.fn sys( mut foos: Query<&mut Foo>, tree: Query<(Option<&Bar>, Relations<R>)>, roots: Query<Entity, Root<R>> ) { tree.traverse::<R>(roots.iter()).track(&mut foos).for_each(|foo, bar, _| { // .. }); }
- Derive macro can handle generic types now.
- Fold breadth API for multi pass algorithms.
fn sys( tree: Query<(Foo, Relations<R>)>, roots: Query<Entity, Root<R>> ) { tree.traverse::<R>(roots.iter()) .track_self() .fold_breadth(|foo, _| /*init*/, |accum, foo, _| /*fold*/) .for_each(|accum, parent_foo, _, child_foo, _| { // .. }); }
Breaking:
- Yeet cursed option hack for relation commands + scope APIs.
- Completely reworked
Scope
API to be more declarative. Not all previous functionality will be possible.world.spawn(bundle).scope::<ChildOf>(|scope| { // x, y, z are implicitly `ChildOf` the last spawned entity scope.add(x) .add(y) .add(z) .scope::<ChildOf>(|scope| { // a, b are implicitly `ChildOf` the last spawned entity (z) scope.add(a) .add(b); }); });
- Improved macro hygiene. All property overrides are done through the
aery
attribute.- Available attributes:
Counted
,Recursive
,Total
,Poly
(previously multi),Symmetric
.
#[derive(Relation)] #[aery(Recursive)] struct R;
- Available attributes:
- Edge direction changes for all operations is now done through the
Up
modifier. All opereations use hosts by default. To use targets useUp
.fn sys(foos: Query<(&Foo, Relation<R>)>, starts: Query<Entity, Root<R>>) { // descent foos.traverse::<R>(starts.iter()).for_each(|foo, _| { // .. }); // ascent foos.traverse::<Up<R>>(starts.iter()).for_each(|foo, _| { // .. }); }
- Traversal are reworked to make sense with new operations. By default traversal visits each node & to get the old 2 arity ancestor descendant permutations use
.track_self()
. - Rework how
Join
s work for consistent defaults + better composability:- Join on hosts not targets by default which is more common and makes for a consistent edge default direction. Use
Up
for targets. - Separate Joins from Traversals. Joins must be done through the
Relations<R>
world query Item. This adds some rightward drift but significantly reduces API complexity & allows joins to work on tracked query items. - Split
ControlFlow
intoJCF
andTCF
.
- Join on hosts not targets by default which is more common and makes for a consistent edge default direction. Use
0.3.1
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.
0.2
New in 0.2
- Logging for
Set
command. - Derive macros for
Relation
.
// Change cleanup behavior
#[derive(Relation)]
#[cleanup(policy = "Recursive")]
struct R;
// Change arity
#[derive(Relation)]
#[multi]
struct R;
- Ancestors now provided when traversing a hierarchy.
fn sys(a: Query<(&A, Relations<R>)>, roots: Query<Entity, Root<R>>) {
q.ops().breadth_first::<R>(roots.iter()).for_each(|a_ancestor, a| {
// ..
})
}
UnsetAll
command to remove all relation targets of a given type from an entity.Withdraw
command for entities to remove themselves as targets from relations of a given type.- More granular
ControlFlow
optionsControlFlow::FastForward(n)
: Advance the nth join to the next valid permutation skipping any permutations in between.ControlFlow::Walk
: Walk to the next entity in a traversal, skipping any remaining permutations to iterate for the current entity.
Breaking changes
- For each arity changes.
- Various type and module name changes.
Other
- License is now dual MIT + Apache 2.0.
- Various doc improvements.