Skip to main content

Scene3D

Struct Scene3D 

Source
pub struct Scene3D {
    pub camera: Camera3D,
    pub lights: Vec<Light3D>,
    pub meshes: Vec<Mesh3D>,
    /* private fields */
}
Expand description

Top-Level 3D Scene representation embedded in a Strata Viewport.

The background, celestial, cloud, overlay, and texture store state are private so adding them does not break struct literals written by existing callers. Use the with_* builders; the accessors below read them back.

Fields§

§camera: Camera3D§lights: Vec<Light3D>§meshes: Vec<Mesh3D>

Implementations§

Source§

impl Scene3D

Source

pub fn new() -> Scene3D

Source

pub fn with_retained_terrain( self, terrain: Arc<RetainedTerrainFrame>, ) -> Scene3D

Source

pub fn set_retained_terrain( &mut self, terrain: Option<Arc<RetainedTerrainFrame>>, )

Source

pub fn retained_terrain(&self) -> Option<&Arc<RetainedTerrainFrame>>

Source

pub fn with_retained_handle(self, handle: RetainedScene3D) -> Scene3D

Source

pub fn set_retained_handle(&mut self, handle: Option<RetainedScene3D>)

Source

pub fn retained_handle(&self) -> Option<&RetainedScene3D>

Source

pub fn cache_fingerprint(&self) -> u64

Computes a deterministic 64-bit fingerprint capturing scene generation, camera state, terrain/mesh geometry revisions, background, lighting, and atmosphere settings so GPU presenters can reuse a cached offscreen 3D color attachment whenever only the 2D UI changes.

Source

pub fn add_mesh(&mut self, mesh: Mesh3D)

Source

pub fn add_light(&mut self, light: Light3D)

Source

pub fn with_background(self, background: Background3D) -> Scene3D

Replaces the background fill used before geometry is drawn.

Source

pub fn with_celestial(self, body: CelestialBody3D) -> Scene3D

Adds an emissive celestial body.

Source

pub fn with_cloud_shell(self, shell: CloudShell3D) -> Scene3D

Adds a translucent cloud shell.

Source

pub fn with_overlay(self, overlay: Overlay3D) -> Scene3D

Attaches the overlay pass drawn after geometry.

Source

pub fn overlay(&self) -> Option<&Overlay3D>

Source

pub fn overlay_mut(&mut self) -> &mut Overlay3D

Returns a mutable reference to the scene’s 3D overlay pass, initializing an empty Overlay3D if none is attached yet.

Source

pub fn with_textures(self, textures: Arc<TextureStore>) -> Scene3D

Attaches a shared crate::texture3d::TextureStore carried with the scene through DrawCommand::DrawViewport3D into live window and offscreen rasterizers.

Source

pub fn set_textures(&mut self, textures: Option<Arc<TextureStore>>)

Sets or clears the shared crate::texture3d::TextureStore attached to this scene.

Source

pub fn textures(&self) -> Option<&Arc<TextureStore>>

Borrows the shared crate::texture3d::TextureStore handle attached to this scene, if any.

Source

pub fn textures_deref(&self) -> Option<&TextureStore>

Borrows the underlying crate::texture3d::TextureStore attached to this scene, if any.

Source

pub fn with_camera_up(self, up: [f64; 3]) -> Scene3D

Sets the camera’s up direction. A downward-looking camera has no unique screen up from the world Y axis, so scenes that care about roll should declare it, for example the local east-north-up frame at a ground focus.

Source

pub fn camera_up(&self) -> Option<[f64; 3]>

Source

pub fn background(&self) -> Background3D

Source

pub fn celestial(&self) -> &[CelestialBody3D]

Source

pub fn cloud_shells(&self) -> &[CloudShell3D]

Trait Implementations§

Source§

impl Clone for Scene3D

Source§

fn clone(&self) -> Scene3D

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Scene3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Scene3D

Source§

fn default() -> Scene3D

Returns the “default value” for a type. Read more
Source§

impl IntoScene3DProp for Scene3D

Source§

impl PartialEq for Scene3D

Source§

fn eq(&self, other: &Scene3D) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Scene3D

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoInitialState<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,