struct OpenScene {
path: PathBuf,
world: World,
entity_assets: HashMap<Entity, RenderableAsset>,
selected: Option<Entity>,
hovered: Option<Entity>,
renaming: Option<Entity>,
rename_buffer: String,
fly_camera: FlyCamera,
dirty: bool,
}Expand description
One open scene tab: its own World, entity-asset tracking, hierarchy/inspector selection
state, and viewport camera — everything that used to be a single set of fields directly on
EditorScene before a project could have more than one scene open for editing at once. Kept
fully loaded in memory for as long as its tab stays open (see EditorScene::open_scenes),
unlike the old single-scene design, which discarded and reloaded a scene’s World from disk
on every switch.
Fields§
§path: PathBufProject-relative path, e.g. "scenes/main.ron" — this tab’s identity; a scene can only be
open in one tab at a time (see EditorScene::switch_or_open_scene).
world: World§entity_assets: HashMap<Entity, RenderableAsset>§selected: Option<Entity>§hovered: Option<Entity>The entity currently under the mouse cursor in the 3D viewport, if any. Recomputed every
frame this tab is active (unlike selected, which only changes on click) so the hovered
model can blink.
renaming: Option<Entity>§rename_buffer: String§fly_camera: FlyCameraThis tab’s own viewport camera controller — kept per-tab (rather than shared) so switching tabs doesn’t disturb whatever framing you last left each scene at.
dirty: boolWhether this tab has edits not yet written to disk — set whenever the UI mutates its
world/entity_assets (see ui::UiRequests::edited), cleared by a successful Save/
Export/tab-close autosave. Surfaced as a * on its tab (see ui::draw_scene_tabs) and
drives the pre-Play “unsaved changes” prompt (see EditorScene::play_confirmation):
scene.change(...) reads a scene’s .ron straight off disk (see
libdqg::scripting’s WorldCommand::ChangeScene), so a dirty other open tab would
otherwise be silently stale to a script that jumps to it mid-Play, even though its real,
unsaved contents are fully visible on screen right now.
Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OpenScene
impl !UnwindSafe for OpenScene
impl Freeze for OpenScene
impl Send for OpenScene
impl Sync for OpenScene
impl Unpin for OpenScene
impl UnsafeUnpin for OpenScene
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> 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> DowncastSync for T
impl<T> DowncastSync 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>
§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