pub struct Interactive {
worlds: SceneHandles,
render: Entity,
renderer: Entity,
pub render_world: Entity,
pub target: ResHandle<Texture>,
stepper: SceneStepper,
frame: Frame,
samples: Vec<f32>,
recording: Option<RecordingHandle>,
device: Device,
queue: Queue,
}Expand description
An interactive scene stepping inline: one frame per call, no pacing of its own.
Fields§
§worlds: SceneHandles§render: Entity§renderer: Entity§render_world: EntityThe entity the render sub-world is spawned under.
target: ResHandle<Texture>The texture the offscreen pass draws into. Its resource id is what a caller reads frames back through.
stepper: SceneStepper§frame: Frame§samples: Vec<f32>§recording: Option<RecordingHandle>§device: Device§queue: QueueImplementations§
Source§impl Interactive
impl Interactive
Sourcepub fn step(&mut self, host: &World, frames: u32)
pub fn step(&mut self, host: &World, frames: u32)
Step frames frames: dispatch the queued input, advance every world and
pull the mix the frames would have played.
Nothing is drawn here, so a run that only reads the state back rather
than the picture costs no draw calls. Interactive::draw draws the
frame where the scene then stands, which is the same frame a step would
have drawn: a draw does not advance the scene, and what it does write is
only what a frame publishes for its readers, which the next frame
replaces anyway.
Sourcepub fn worlds_handle(&self) -> &SceneHandles
pub fn worlds_handle(&self) -> &SceneHandles
The handles the scene’s worlds were spawned under.
The panel buttons the last drawn frame laid out, keyed by label.
The layout lives on the gameplay world, refreshed on every tick.
Sourcepub fn render_frame(&self, host: &World) -> Vec<u8> ⓘ
pub fn render_frame(&self, host: &World) -> Vec<u8> ⓘ
Draw the frame where the scene stands and read its pixels back.
The readback blocks until the copy lands. Drawing is what publishes the target the panels lay out against, so nothing is laid out until one frame has been drawn.
Sourcepub fn draw(&self, host: &World)
pub fn draw(&self, host: &World)
Draw the frame where the scene stands, into the offscreen texture.
The render sub-world catches up on the jobs queued for it first, so the frame draws the scene as the steps left it rather than as the jobs found it.
Sourcepub fn click(&mut self, host: &World, position: [f32; 2])
pub fn click(&mut self, host: &World, position: [f32; 2])
Click at position: move the pointer there, then press and release
before the next frame, the sequence the MCP input tool sends.
Sourcepub fn start_recording(&mut self, host: &World, max_seconds: f32)
pub fn start_recording(&mut self, host: &World, max_seconds: f32)
Start recording the mix the audio world fills.
The recording lives on the audio world, so its fills are counted even though the world is stepped from here.
Sourcepub fn stop_recording(&mut self, host: &World) -> Option<Recording>
pub fn stop_recording(&mut self, host: &World) -> Option<Recording>
Stop the recording and take the samples it captured.
Auto Trait Implementations§
impl !RefUnwindSafe for Interactive
impl !UnwindSafe for Interactive
impl Forget for Interactive
impl Freeze for Interactive
impl Send for Interactive
impl Sync for Interactive
impl Unpin for Interactive
impl UnsafeUnpin for Interactive
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> Component for Twhere
T: 'static,
§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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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> 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> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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<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> MaybeSync for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.