pub struct MeshAsset {
pub vertices: Vec<Vertex>,
pub indices: Vec<u32>,
pub material: Option<String>,
pub aabb: Option<([f32; 3], [f32; 3])>,
}Expand description
A loaded triangle mesh.
Fields§
§vertices: Vec<Vertex>Vertex buffer.
indices: Vec<u32>Index buffer (triangles: every 3 indices = 1 triangle).
material: Option<String>Name of the material assigned to this mesh (references a MaterialAsset).
aabb: Option<([f32; 3], [f32; 3])>Axis-aligned bounding box: (min, max).
Implementations§
Source§impl MeshAsset
impl MeshAsset
Sourcepub fn compute_aabb(&mut self)
pub fn compute_aabb(&mut self)
Compute the AABB from the vertex data and cache it.
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Number of triangles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MeshAsset
impl RefUnwindSafe for MeshAsset
impl Send for MeshAsset
impl Sync for MeshAsset
impl Unpin for MeshAsset
impl UnsafeUnpin for MeshAsset
impl UnwindSafe for MeshAsset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more