pub type WithComputedMassProperty = Or<(With<ComputedMass>, With<ComputedAngularInertia>, With<ComputedCenterOfMass>)>;
Expand description
A query filter for entities with ComputedMass
, ComputedAngularInertia
, or ComputedCenterOfMass
.
Aliased Type§
struct WithComputedMassProperty(/* private fields */);
Trait Implementations
Source§impl<F0, F1, F2> QueryFilter for Or<(F0, F1, F2)>
impl<F0, F1, F2> QueryFilter for Or<(F0, F1, F2)>
Source§const IS_ARCHETYPAL: bool
const IS_ARCHETYPAL: bool
Returns true if (and only if) this Filter relies strictly on archetypes to limit which
components are accessed by the Query. Read more
Source§unsafe fn filter_fetch(
fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'_>,
entity: Entity,
table_row: TableRow,
) -> bool
unsafe fn filter_fetch( fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'_>, entity: Entity, table_row: TableRow, ) -> bool
Source§impl<F0, F1, F2> WorldQuery for Or<(F0, F1, F2)>
SAFETY:
fetch
accesses are a subset of the subqueries’ accesses
This is sound because update_component_access
adds accesses according to the implementations of all the subqueries.
update_component_access
replace the filters with a disjunction where every element is a conjunction of the previous filters and the filters of one of the subqueries.
This is sound because matches_component_set
returns a disjunction of the results of the subqueries’ implementations.
impl<F0, F1, F2> WorldQuery for Or<(F0, F1, F2)>
SAFETY:
fetch
accesses are a subset of the subqueries’ accesses
This is sound because update_component_access
adds accesses according to the implementations of all the subqueries.
update_component_access
replace the filters with a disjunction where every element is a conjunction of the previous filters and the filters of one of the subqueries.
This is sound because matches_component_set
returns a disjunction of the results of the subqueries’ implementations.
Source§const IS_DENSE: bool
const IS_DENSE: bool
Returns true if (and only if) every table of every archetype matched by this fetch contains
all of the matched components. This is used to select a more efficient “table iterator”
for “dense” queries. If this returns true,
WorldQuery::set_table
must be used before
WorldQuery::fetch
can be called for iterators. If this returns false,
WorldQuery::set_archetype
must be used before WorldQuery::fetch
can be called for
iterators.Source§type Fetch<'w> = (OrFetch<'w, F0>, OrFetch<'w, F1>, OrFetch<'w, F2>)
type Fetch<'w> = (OrFetch<'w, F0>, OrFetch<'w, F1>, OrFetch<'w, F2>)
Per archetype/table state used by this
WorldQuery
to fetch Self::Item
Source§type Item<'w> = bool
type Item<'w> = bool
The item returned by this
WorldQuery
For QueryData
this will be the item returned by the query.
For QueryFilter
this will be either ()
, or a bool
indicating whether the entity should be included
or a tuple of such things.Source§type State = (<F0 as WorldQuery>::State, <F1 as WorldQuery>::State, <F2 as WorldQuery>::State)
type State = (<F0 as WorldQuery>::State, <F1 as WorldQuery>::State, <F2 as WorldQuery>::State)
State used to construct a
Self::Fetch
. This will be cached inside QueryState
,
so it is best to move as much data / computation here as possible to reduce the cost of
constructing Self::Fetch
.Source§fn shrink<'wlong, 'wshort>(
item: <Or<(F0, F1, F2)> as WorldQuery>::Item<'wlong>,
) -> <Or<(F0, F1, F2)> as WorldQuery>::Item<'wshort>where
'wlong: 'wshort,
fn shrink<'wlong, 'wshort>(
item: <Or<(F0, F1, F2)> as WorldQuery>::Item<'wlong>,
) -> <Or<(F0, F1, F2)> as WorldQuery>::Item<'wshort>where
'wlong: 'wshort,
This function manually implements subtyping for the query items.
Source§fn shrink_fetch<'wlong, 'wshort>(
fetch: <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'wlong>,
) -> <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'wshort>where
'wlong: 'wshort,
fn shrink_fetch<'wlong, 'wshort>(
fetch: <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'wlong>,
) -> <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'wshort>where
'wlong: 'wshort,
This function manually implements subtyping for the query fetches.
Source§unsafe fn init_fetch<'w>(
world: UnsafeWorldCell<'w>,
state: &<Or<(F0, F1, F2)> as WorldQuery>::State,
last_run: Tick,
this_run: Tick,
) -> <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>
unsafe fn init_fetch<'w>( world: UnsafeWorldCell<'w>, state: &<Or<(F0, F1, F2)> as WorldQuery>::State, last_run: Tick, this_run: Tick, ) -> <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>
Creates a new instance of this fetch. Read more
Source§unsafe fn set_table<'w>(
fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>,
state: &<Or<(F0, F1, F2)> as WorldQuery>::State,
table: &'w Table,
)
unsafe fn set_table<'w>( fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>, state: &<Or<(F0, F1, F2)> as WorldQuery>::State, table: &'w Table, )
Adjusts internal state to account for the next
Table
. This will always be called on tables
that match this WorldQuery
. Read moreSource§unsafe fn set_archetype<'w>(
fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>,
state: &<Or<(F0, F1, F2)> as WorldQuery>::State,
archetype: &'w Archetype,
table: &'w Table,
)
unsafe fn set_archetype<'w>( fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>, state: &<Or<(F0, F1, F2)> as WorldQuery>::State, archetype: &'w Archetype, table: &'w Table, )
Adjusts internal state to account for the next
Archetype
. This will always be called on
archetypes that match this WorldQuery
. Read moreSource§unsafe fn fetch<'w>(
fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>,
_entity: Entity,
_table_row: TableRow,
) -> <Or<(F0, F1, F2)> as WorldQuery>::Item<'w>
unsafe fn fetch<'w>( fetch: &mut <Or<(F0, F1, F2)> as WorldQuery>::Fetch<'w>, _entity: Entity, _table_row: TableRow, ) -> <Or<(F0, F1, F2)> as WorldQuery>::Item<'w>
Fetch
Self::Item
for either the given entity
in the current Table
,
or for the given entity
in the current Archetype
. This must always be called after
WorldQuery::set_table
with a table_row
in the range of the current Table
or after
WorldQuery::set_archetype
with a entity
in the current archetype. Read moreSource§fn update_component_access(
state: &<Or<(F0, F1, F2)> as WorldQuery>::State,
access: &mut FilteredAccess<ComponentId>,
)
fn update_component_access( state: &<Or<(F0, F1, F2)> as WorldQuery>::State, access: &mut FilteredAccess<ComponentId>, )
Source§fn init_state(world: &mut World) -> <Or<(F0, F1, F2)> as WorldQuery>::State
fn init_state(world: &mut World) -> <Or<(F0, F1, F2)> as WorldQuery>::State
Creates and initializes a
State
for this WorldQuery
type.Source§fn get_state(
components: &Components,
) -> Option<<Or<(F0, F1, F2)> as WorldQuery>::State>
fn get_state( components: &Components, ) -> Option<<Or<(F0, F1, F2)> as WorldQuery>::State>
Source§fn matches_component_set(
_state: &<Or<(F0, F1, F2)> as WorldQuery>::State,
_set_contains_id: &impl Fn(ComponentId) -> bool,
) -> bool
fn matches_component_set( _state: &<Or<(F0, F1, F2)> as WorldQuery>::State, _set_contains_id: &impl Fn(ComponentId) -> bool, ) -> bool
Source§fn set_access(_state: &mut Self::State, _access: &FilteredAccess<ComponentId>)
fn set_access(_state: &mut Self::State, _access: &FilteredAccess<ComponentId>)
Sets available accesses for implementors with dynamic access such as
FilteredEntityRef
or FilteredEntityMut
. Read more