pub struct View<'a> {
pub dt: f32,
pub elapsed: f32,
pub vars: &'a [Val],
pub locals: &'a [Val],
pub bindings: &'a mut [Option<Val>],
pub queries: &'a [Vec<Entity>],
pub by_name: &'a dyn Fn(AssetId) -> Option<Entity>,
pub transforms: &'a dyn Fn(Entity) -> Option<Transform>,
pub alive: &'a dyn Fn(Entity) -> bool,
pub self_entity: Option<Entity>,
pub trace: &'a mut Option<Vec<u32>>,
}Expand description
What a behavior may read this tick.
Fields§
§dt: f32Seconds this tick advances.
elapsed: f32Seconds of simulated time so far.
vars: &'a [Val]The world’s variables, in slot order.
locals: &'a [Val]This instance’s locals, in slot order.
bindings: &'a mut [Option<Val>]Exactly as wide as the body’s binding high-water mark, so a slot is always in range and the frame never grows mid-run.
queries: &'a [Vec<Entity>]The entities each declared query selected this tick, in slot order.
by_name: &'a dyn Fn(AssetId) -> Option<Entity>Resolves a name to the entity carrying it.
transforms: &'a dyn Fn(Entity) -> Option<Transform>Reads an entity’s transform.
alive: &'a dyn Fn(Entity) -> boolWhether an entity still exists.
self_entity: Option<Entity>The entity this run is scoped to, if any.
trace: &'a mut Option<Vec<u32>>Node ids executed this run, recorded only while tracing is requested
(None costs one branch per node).
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for View<'a>
impl<'a> !Send for View<'a>
impl<'a> !Sync for View<'a>
impl<'a> !UnwindSafe for View<'a>
impl<'a> Freeze for View<'a>
impl<'a> Unpin for View<'a>
impl<'a> UnsafeUnpin for View<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more