[][src]Struct embree::scene::Scene

pub struct Scene<'a> { /* fields omitted */ }

A scene containing various geometry for rendering. Geometry can be added and removed by attaching and detaching it, after which the scene BVH can be built via commit which will return a CommittedScene which can be used for ray queries.

Implementations

impl<'a> Scene<'a>[src]

pub fn new(device: &'a Device) -> Scene<'_>[src]

pub fn attach_geometry(&mut self, mesh: Geometry<'a>) -> u32[src]

Attach a new geometry to the scene. Returns the scene local ID which can than be used to find the hit geometry from the ray ID member. A geometry can only be attached to one Scene at a time, per the Embree documentation. The geometry can be detached from the scene to move it to another one.

pub fn deattach_geometry(&mut self, id: u32) -> Option<Geometry<'a>>[src]

Detach the geometry from the scene

pub fn get_geometry(&self, id: u32) -> Option<&Geometry<'a>>[src]

Look up a geometry in the scene by the ID returned from attach_geometry

pub fn get_geometry_mut(&mut self, id: u32) -> Option<&mut Geometry<'a>>[src]

Look up a geometry in the scene by the ID returned from attach_geometry

pub fn iter(&self) -> Iter<'_, u32, Geometry<'a>>[src]

Get an iterator over the geometry map

pub fn iter_mut(&mut self) -> IterMut<'_, u32, Geometry<'a>>[src]

Get an iterator over the geometry map

pub fn commit(&'a self) -> CommittedScene<'a>[src]

Commit the scene to build the BVH on top of the geometry to allow for ray tracing the scene. The returned CommittedScene can be used for intersection and occlusion tests. The Scene can't be modified while the CommittedScene is active.

pub unsafe fn handle(&self) -> RTCScene[src]

Get the underlying handle to the scene, e.g. for passing it to native code or ISPC kernels.

Trait Implementations

impl<'a> Drop for Scene<'a>[src]

impl<'a> Sync for Scene<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Scene<'a>

impl<'a> !Send for Scene<'a>

impl<'a> Unpin for Scene<'a>

impl<'a> UnwindSafe for Scene<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.