[−][src]Struct tray_rust::geometry::mesh::Mesh
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]
positions: Arc<Vec<Point>>,
normals: Arc<Vec<Normal>>,
texcoords: Arc<Vec<Point>>,
indices: Vec<u32>
) -> Mesh
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]
fn intersect(&self, ray: &mut Ray) -> Option<DifferentialGeometry>
[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]
T: Geometry + Boundable + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,