[][src]Struct tray_rust::geometry::mesh::Mesh

pub struct Mesh {
    pub bvh: BVH<Triangle>,
}

A mesh composed of triangles, specified by directly passing the position, normal and index buffers for the triangles making up the mesh

Fields

bvh: BVH<Triangle>

Methods

impl Mesh[src]

pub fn new(
    positions: Arc<Vec<Point>>,
    normals: Arc<Vec<Normal>>,
    texcoords: Arc<Vec<Point>>,
    indices: Vec<u32>
) -> Mesh
[src]

Create a new Mesh from the triangles described in the buffers passed This data could come from an OBJ file via tobj for example.

pub fn load_obj(file_name: &Path) -> HashMap<String, Arc<Mesh>>[src]

Load all the meshes defined in an OBJ file and return them in a hashmap that maps the model's name in the file to its loaded mesh. TODO: Don't build the BVH until we actually use the mesh in the scene, will reduce scene load time. TODO: Currently materials are ignored

Trait Implementations

impl Geometry for Mesh[src]

impl Boundable for Mesh[src]

Auto Trait Implementations

impl Send for Mesh

impl Sync for Mesh

impl Unpin for Mesh

impl UnwindSafe for Mesh

impl RefUnwindSafe for Mesh

Blanket Implementations

impl<T> BoundableGeom for T where
    T: Geometry + Boundable + ?Sized
[src]

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

impl<T> From<T> for 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.

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

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

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

impl<T> SetParameter for T[src]