Struct Scene

Source
pub struct Scene {
    pub device: Device,
    /* private fields */
}

Fields§

§device: Device

Implementations§

Source§

impl Scene

Source

pub fn try_new(device: Device, options: SceneOptions) -> Result<Self>

Constructs a new Scene instance from the given options.

§Arguments
  • device - A reference to the Device instance.
  • options - The options for creating the scene.
§Returns

A Result containing the Scene instance if successful, or an error if an error occurred.

§Example
use embree4_rs::*;
use embree4_sys::*;

let device = Device::try_new(None).unwrap();
let options = SceneOptions {
    build_quality: RTCBuildQuality::HIGH,
    flags: RTCSceneFlags::COMPACT | RTCSceneFlags::ROBUST,
};
let scene = Scene::try_new(&device, options).unwrap();
Source

pub fn set_build_quality(&self, quality: RTCBuildQuality) -> Result<()>

Sets the build quality of the scene.

§Arguments
  • quality - The build quality to set.
§Returns

A Result indicating success or failure.

Source

pub fn set_flags(&self, flags: RTCSceneFlags) -> Result<()>

Sets the flags of the scene.

§Arguments
  • flags - The flags to set.
§Returns

A Result indicating success or failure.

Source

pub fn attach_geometry(&self, geometry: &dyn Geometry) -> Result<u32>

Attaches the given geometry to the scene.

§Arguments
  • geometry - A reference to the Geometry instance to attach.
§Returns
  • A Result containing the geometry ID if successful, or an error if an error occurred.
Source

pub fn commit(self) -> Result<CommittedScene>

Commits the scene.

§Returns

A Result containing the CommittedScene instance if successful, or an error if an error occurred.

§Example
use embree4_rs::*;
use embree4_sys::*;

let device = Device::try_new(None).unwrap();
let options = Default::default();
let scene = Scene::try_new(&device, options).unwrap();
let scene = scene.commit().unwrap();

Trait Implementations§

Source§

impl Drop for Scene

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Scene

§

impl RefUnwindSafe for Scene

§

impl !Send for Scene

§

impl !Sync for Scene

§

impl Unpin for Scene

§

impl UnwindSafe for Scene

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.