Skip to main content

RetainedScene3D

Struct RetainedScene3D 

Source
pub struct RetainedScene3D { /* private fields */ }
Expand description

Thread-safe retained 3D scene handle shared between host state (camera/worker) and Canvas3D.

Calling RetainedScene3D::update_camera updates camera uniforms in place and bumps only camera_generation, allowing the GPU backend to re-render at uncapped framerates without rebuilding DOM nodes, layout, display lists, or tile meshes.

Implementations§

Source§

impl RetainedScene3D

Source

pub fn new(camera: RetainedCameraUniforms) -> Self

Source

pub fn geo_revision(&self) -> u64

Monotonic revision of the latest published geo_mesh_assets / geo_instances.

Source

pub fn update_camera(&self, camera: RetainedCameraUniforms)

Source

pub fn update_terrain(&self, terrain: Arc<RetainedTerrainFrame>)

Source

pub fn update_terrain_preserving_camera( &self, terrain: Arc<RetainedTerrainFrame>, )

Publishes a new terrain tile frame from a background LOD worker while preserving the live camera, any main-thread camera-locked particle layers or GPU ocean state when omitted, and any newer main-thread geo_mesh_assets/geo_instances (preventing 1-frame rubber-banding).

Source

pub fn update_terrain_with_camera_preserving_overlays( &self, terrain: Arc<RetainedTerrainFrame>, )

Atomically publishes a new terrain tile frame together with its matching camera uniforms while preserving main-thread camera-locked particle layers, GPU ocean state, and newer main-thread geo_mesh_assets/geo_instances when omitted or stale.

Used on the single boundary frame switching between spherical/tangent 3D and the canonical 2D flat-map plane so terrain geometry and camera never mismatch even transiently.

Source

pub fn request_gpu_continuation(&self)

Marks the retained 3D scene dirty for one more frame when per-frame GPU texture/mesh upload budgets deferred remaining work.

Source

pub fn update_camera_and_dynamic_meshes( &self, camera: RetainedCameraUniforms, dynamic_meshes: Vec<RetainedDynamicMesh>, )

Updates camera uniforms and replaces only dynamic 3D overlays (e.g. orbital satellites) without rebuilding or re-allocating cached terrain tiles, textures, particle volumes, ocean, or environment assets.

Source

pub fn update_geo_objects( &self, geo_mesh_assets: Arc<Vec<Arc<RetainedMeshAsset>>>, geo_instances: Arc<Vec<RetainedGeoInstance>>, )

Updates hardware-instanced geodetic objects in O(1) TerrainFrame shallow-clone time without rebuilding terrain tiles, textures, particle volumes, ocean, or environment state.

Source

pub fn update_camera_and_world_overlays( &self, camera: RetainedCameraUniforms, dynamic_meshes: Vec<RetainedDynamicMesh>, geo_mesh_assets: Arc<Vec<Arc<RetainedMeshAsset>>>, geo_instances: Arc<Vec<RetainedGeoInstance>>, )

Updates camera uniforms, dynamic 3D overlays, and hardware-instanced geodetic objects atomically.

Source

pub fn update_camera_and_geo_objects( &self, camera: RetainedCameraUniforms, geo_mesh_assets: Arc<Vec<Arc<RetainedMeshAsset>>>, geo_instances: Arc<Vec<RetainedGeoInstance>>, )

Updates camera uniforms and hardware-instanced geodetic objects atomically while preserving existing terrain meshes, textures, particle volumes, ocean, and dynamic 3D overlays.

Source

pub fn update_particles( &self, particle_layers: Arc<Vec<RetainedParticleLayer>>, particle_textures: Arc<Vec<Arc<RetainedTileTexture>>>, )

Updates only GPU-instanced 2D camera-local particle volumes in O(1) without touching terrain, dynamic meshes, ocean, or geodetic objects.

Source

pub fn update_camera_and_particles( &self, camera: RetainedCameraUniforms, particle_layers: Arc<Vec<RetainedParticleLayer>>, particle_textures: Arc<Vec<Arc<RetainedTileTexture>>>, )

Updates camera uniforms and GPU-instanced 2D camera-local particle volumes atomically in O(1).

Source

pub fn update_camera_and_ocean( &self, camera: RetainedCameraUniforms, ocean: Option<Arc<RetainedOceanSurface>>, )

Updates camera uniforms and GPU ocean surface descriptor atomically in O(1).

Source

pub fn update_camera_and_particles_and_ocean( &self, camera: RetainedCameraUniforms, particle_layers: Arc<Vec<RetainedParticleLayer>>, particle_textures: Arc<Vec<Arc<RetainedTileTexture>>>, ocean: Option<Arc<RetainedOceanSurface>>, )

Updates camera uniforms, particle volumes, and GPU ocean surface descriptor atomically in O(1).

Source

pub fn update_camera_and_geo_and_particles( &self, camera: RetainedCameraUniforms, geo_mesh_assets: Arc<Vec<Arc<RetainedMeshAsset>>>, geo_instances: Arc<Vec<RetainedGeoInstance>>, particle_layers: Arc<Vec<RetainedParticleLayer>>, particle_textures: Arc<Vec<Arc<RetainedTileTexture>>>, )

Updates camera uniforms, hardware-instanced geodetic objects, and particle volumes atomically.

Source

pub fn update_camera_and_world_and_particles( &self, camera: RetainedCameraUniforms, dynamic_meshes: Vec<RetainedDynamicMesh>, geo_mesh_assets: Arc<Vec<Arc<RetainedMeshAsset>>>, geo_instances: Arc<Vec<RetainedGeoInstance>>, particle_layers: Arc<Vec<RetainedParticleLayer>>, particle_textures: Arc<Vec<Arc<RetainedTileTexture>>>, )

Updates camera uniforms, dynamic overlays, geodetic objects, and particle volumes atomically.

Source

pub fn update_camera_and_world_and_particles_and_ocean( &self, camera: RetainedCameraUniforms, dynamic_meshes: Vec<RetainedDynamicMesh>, geo_mesh_assets: Arc<Vec<Arc<RetainedMeshAsset>>>, geo_instances: Arc<Vec<RetainedGeoInstance>>, particle_layers: Arc<Vec<RetainedParticleLayer>>, particle_textures: Arc<Vec<Arc<RetainedTileTexture>>>, ocean: Option<Arc<RetainedOceanSurface>>, )

Updates camera uniforms, dynamic overlays, geodetic objects, particle volumes, and GPU ocean atomically.

Source

pub fn set_fallback_scene(&self, scene: Arc<Scene3D>)

Source

pub fn camera_generation(&self) -> u64

Source

pub fn geometry_generation(&self) -> u64

Source

pub fn overlay_generation(&self) -> u64

Source

pub fn generations(&self) -> (u64, u64, u64)

Source

pub fn camera(&self) -> RetainedCameraUniforms

Source

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

Source

pub fn fallback_scene(&self) -> Option<Arc<Scene3D>>

Trait Implementations§

Source§

impl Clone for RetainedScene3D

Source§

fn clone(&self) -> Self

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 RetainedScene3D

Source§

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

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

impl PartialEq for RetainedScene3D

Source§

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

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

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

Inequality operator !=. Read more

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> 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,