Skip to main content

Scene3d

Struct Scene3d 

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

Ready 3D visual state rendered with one camera and depth attachment.

Implementations§

Source§

impl Scene3d

Source

pub fn new(background: Color) -> Result<Self, Scene3dError>

Creates an empty scene with a normalized opaque clear color.

Source

pub fn with_budget( background: Color, budget: Scene3dBudget, ) -> Result<Self, Scene3dError>

Creates a lazily allocated scene with explicit live-resource limits.

Source

pub fn try_push( &mut self, mesh: &RetainedMesh3d, transform: Transform3d, style: MeshStyle3d, ) -> Result<Object3dId, Scene3dError>

Adds a retained object and returns a stable handle for later updates.

Source

pub const fn background(&self) -> Color

Returns the normalized finite opaque target clear color.

Source

pub fn instances(&self) -> &[Mesh3dInstance]

Returns objects in host insertion order; depth determines visibility.

Source

pub fn object_count(&self) -> usize

Returns the number of independently transformed objects.

Source

pub const fn budget(&self) -> Scene3dBudget

Returns the configured simultaneous-live and retained-capacity limits.

Source

pub fn statistics(&self) -> Scene3dStatistics

Returns deduplicated allocation accounting without allocating scratch.

Source

pub fn instance( &self, object_id: Object3dId, ) -> Result<&Mesh3dInstance, Scene3dError>

Resolves a live scene-provenance-checked handle in constant time.

Source

pub fn remove( &mut self, object_id: Object3dId, ) -> Result<Mesh3dInstance, Scene3dError>

Removes an object, preserving survivor IDs and insertion order.

Removal shifts dense storage in O(N); transform/style/visibility lookups remain O(1). Lookup slots are reused with never-repeated numeric IDs. The returned instance owns its retired mesh reference. Dropping it releases that reference, not necessarily in-flight driver memory.

Source

pub fn set_mesh( &mut self, object_id: Object3dId, mesh: &RetainedMesh3d, ) -> Result<Scene3dMeshUpdateReport, Scene3dError>

Rebinds only this object to an immutable mesh after complete validation.

Shared users of the old mesh are unchanged. Transform, style, visibility and ID survive. The accepted resource limits apply to final scene state; replacement overlap is at most old plus incoming mesh and is reported. Synchronous errors preserve all live visual state. In-flight submissions retain their old GPU references; no immediate driver retirement is promised.

Source

pub fn visible_object_count(&self) -> usize

Returns objects currently participating in rendering.

Source

pub fn set_transform( &mut self, object_id: Object3dId, transform: Transform3d, ) -> Result<(), Scene3dError>

Replaces one object’s model transform without touching retained topology.

Source

pub fn set_style( &mut self, object_id: Object3dId, style: MeshStyle3d, ) -> Result<(), Scene3dError>

Replaces one object’s complete extensible visual material bundle.

Source

pub fn set_visible( &mut self, object_id: Object3dId, visible: bool, ) -> Result<(), Scene3dError>

Shows or hides one object without releasing retained topology.

Source

pub fn set_wireframe( &mut self, object_id: Object3dId, wireframe: Option<WireframeStyle3d>, ) -> Result<(), Scene3dError>

Enables or disables explicit visible/hidden edges for one object.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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,