[][src]Struct rpt::Object

pub struct Object {
    pub shape: Box<dyn Shape>,
    pub material: Material,
}

An object rendered in a scene

In the future, it may be more flexible to have an object trait that alllows a user to get the material at an intersection point. This would make sense to help for something like kd-trees, as it would let you create a kd-tree of different materials, and it would also work well with texture mapping.

Fields

shape: Box<dyn Shape>

Basic geometry of the object

material: Material

Material of the object (possibly simple or complex)

Implementations

impl Object[src]

pub fn new<T: Shape + 'static>(shape: T) -> Self[src]

Create a new object from a shape, with default material

pub fn material(self, material: Material) -> Self[src]

Set the material of the object (builder pattern)

Trait Implementations

impl SceneAdd<Object> for Scene[src]

Auto Trait Implementations

impl !RefUnwindSafe for Object

impl Send for Object

impl Sync for Object

impl Unpin for Object

impl !UnwindSafe for Object

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> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,