pub struct Scene {
pub meshes: Vec<Mesh>,
pub materials: Vec<PbrMaterial>,
pub nodes: Vec<SceneNode>,
pub lighting: LightingEnvironment,
}Expand description
The top-level scene containing all data
Fields§
§meshes: Vec<Mesh>§materials: Vec<PbrMaterial>§nodes: Vec<SceneNode>§lighting: LightingEnvironmentImplementations§
Source§impl Scene
impl Scene
Sourcepub fn single_mesh(
name: impl Into<String>,
mesh: Mesh,
material: PbrMaterial,
) -> Self
pub fn single_mesh( name: impl Into<String>, mesh: Mesh, material: PbrMaterial, ) -> Self
Create a scene with a single mesh, one default material, and one node.
Sourcepub fn compute_aabb(&self) -> Aabb
pub fn compute_aabb(&self) -> Aabb
Compute the world-space bounding box of the scene by traversing all nodes.
Sourcepub fn with_default_lighting(self) -> Self
pub fn with_default_lighting(self) -> Self
Use default lighting (two directional + ambient).
Sourcepub fn with_lighting(self, lighting: LightingEnvironment) -> Self
pub fn with_lighting(self, lighting: LightingEnvironment) -> Self
Replace the lighting environment.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
impl UnwindSafe for Scene
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
Mutably borrows from an owned value. Read more