pub struct ExtractContext<'w> {
world: &'w mut World,
entities: &'w mut HashMap<(FrameItemId, usize), OutputEntity>,
seen: &'w mut HashSet<(FrameItemId, usize)>,
source: FrameItemId,
order: usize,
next_part: &'w mut usize,
transform: DAffine3,
}Expand description
World access, output identity, order, and inherited transform for extraction.
A context belongs to one ranim_core::frame::FrameItem. Recursive values
share its output sequence; transform scopes compose without changing that
sequence. Input data remains unchanged when a frame is rendered again.
Fields§
§world: &'w mut World§entities: &'w mut HashMap<(FrameItemId, usize), OutputEntity>§seen: &'w mut HashSet<(FrameItemId, usize)>§source: FrameItemId§order: usize§next_part: &'w mut usize§transform: DAffine3Implementations§
Source§impl ExtractContext<'_>
impl ExtractContext<'_>
Sourcepub fn world_mut(&mut self) -> &mut World
pub fn world_mut(&mut self) -> &mut World
Access the render world to update resources or perform custom operations.
The current frame and this plugin’s identity state are temporarily scoped
out of the world while extracting. The input value is available as self
in Extract::extract. Directly spawned entities are not tracked by the
context; manage their lifetimes in the implementation.
Sourcepub fn entity<B: Bundle>(&mut self) -> EntityWorldMut<'_>
pub fn entity<B: Bundle>(&mut self) -> EntityWorldMut<'_>
Claim the source’s next persistent output entity.
B identifies the output bundle’s shape. The entity is reused while this
shape stays the same; changing it replaces the entity so old components
cannot remain. Values are inserted by the caller. Components managed
outside B remain the implementation’s responsibility.
An output not claimed on a later frame is despawned.
Sourcepub fn transform(&self) -> DAffine3
pub fn transform(&self) -> DAffine3
The accumulated local-to-world transform for the current value.
Sourcepub fn with_transform<R>(
&mut self,
transform: DAffine3,
extract: impl FnOnce(&mut ExtractContext<'_>) -> R,
) -> R
pub fn with_transform<R>( &mut self, transform: DAffine3, extract: impl FnOnce(&mut ExtractContext<'_>) -> R, ) -> R
Extract a subtree under current * transform, sharing output identities.
fn next_entity(&mut self, bundle_type: TypeId) -> EntityWorldMut<'_>
Auto Trait Implementations§
impl<'w> !RefUnwindSafe for ExtractContext<'w>
impl<'w> !UnwindSafe for ExtractContext<'w>
impl<'w> Freeze for ExtractContext<'w>
impl<'w> Send for ExtractContext<'w>
impl<'w> Sync for ExtractContext<'w>
impl<'w> Unpin for ExtractContext<'w>
impl<'w> UnsafeUnpin for ExtractContext<'w>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> TransformedExt for T
impl<T> TransformedExt for T
Source§fn transformed<G>(self, transform: G) -> Transformed<Self, G>
fn transformed<G>(self, transform: G) -> Transformed<Self, G>
self wrapped with transform stored exactly as G.