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
impl Scene3D
pub fn new() -> Scene3D
pub fn with_retained_terrain( self, terrain: Arc<RetainedTerrainFrame>, ) -> Scene3D
pub fn set_retained_terrain( &mut self, terrain: Option<Arc<RetainedTerrainFrame>>, )
pub fn retained_terrain(&self) -> Option<&Arc<RetainedTerrainFrame>>
pub fn with_retained_handle(self, handle: RetainedScene3D) -> Scene3D
pub fn set_retained_handle(&mut self, handle: Option<RetainedScene3D>)
pub fn retained_handle(&self) -> Option<&RetainedScene3D>
Sourcepub fn cache_fingerprint(&self) -> u64
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.
pub fn add_mesh(&mut self, mesh: Mesh3D)
pub fn add_light(&mut self, light: Light3D)
Sourcepub fn with_background(self, background: Background3D) -> Scene3D
pub fn with_background(self, background: Background3D) -> Scene3D
Replaces the background fill used before geometry is drawn.
Sourcepub fn with_celestial(self, body: CelestialBody3D) -> Scene3D
pub fn with_celestial(self, body: CelestialBody3D) -> Scene3D
Adds an emissive celestial body.
Sourcepub fn with_cloud_shell(self, shell: CloudShell3D) -> Scene3D
pub fn with_cloud_shell(self, shell: CloudShell3D) -> Scene3D
Adds a translucent cloud shell.
Sourcepub fn with_overlay(self, overlay: Overlay3D) -> Scene3D
pub fn with_overlay(self, overlay: Overlay3D) -> Scene3D
Attaches the overlay pass drawn after geometry.
pub fn overlay(&self) -> Option<&Overlay3D>
Sourcepub fn overlay_mut(&mut self) -> &mut Overlay3D
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.
Sourcepub fn with_textures(self, textures: Arc<TextureStore>) -> Scene3D
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.
Sourcepub fn set_textures(&mut self, textures: Option<Arc<TextureStore>>)
pub fn set_textures(&mut self, textures: Option<Arc<TextureStore>>)
Sets or clears the shared crate::texture3d::TextureStore attached to this scene.
Sourcepub fn textures(&self) -> Option<&Arc<TextureStore>>
pub fn textures(&self) -> Option<&Arc<TextureStore>>
Borrows the shared crate::texture3d::TextureStore handle attached to this scene, if any.
Sourcepub fn textures_deref(&self) -> Option<&TextureStore>
pub fn textures_deref(&self) -> Option<&TextureStore>
Borrows the underlying crate::texture3d::TextureStore attached to this scene, if any.
Sourcepub fn with_camera_up(self, up: [f64; 3]) -> Scene3D
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.