[−][src]Struct duku::Mesh
Shape collection for rendering
Example
ⓘThis example is not tested
// setup a triangle let mut mesh = duku.create_mesh(); mesh.vertices = vec![ Vector3::new(-1.0, -1.0), Vector3::new(0.0, 1.0), Vector3::new(1.0, -1.0), ]; mesh.indices = vec![0, 1, 2]; // render a triangle target.draw_mesh(&mesh);
Fields
vertices: Vec<Vector3>
vertex positions
uvs: Vec<Vector2>
vertex UV coordinates
normals: Vec<Vector3>
vertex normal directions
tangents: Vec<Vector3>
vertex tangent directions
colors: Vec<Color>
vertex colors
textures: Vec<u32>
vertex texture indices
indices: Vec<u32>
vertex indices
Implementations
impl Mesh
[src]
pub fn calculate_normals(&mut self)
[src]
Calculate vertex normals automatically smoothing the values to achieve smooth shading.
Note: calls calculate_tangents automatically
pub fn calculate_tangents(&mut self)
[src]
Calculate vertex tangents automatically smoothing the values to achieve smooth shading.
Auto Trait Implementations
impl RefUnwindSafe for Mesh
impl !Send for Mesh
impl !Sync for Mesh
impl Unpin for Mesh
impl UnwindSafe for Mesh
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,