Struct rust_raylib::model::Mesh
source · pub struct Mesh { /* private fields */ }Expand description
Mesh, vertex data and vao/vbo
Implementations§
source§impl Mesh
impl Mesh
sourcepub fn update_buffer(&self, index: u32, data: &[u8], offset: u32)
pub fn update_buffer(&self, index: u32, data: &[u8], offset: u32)
Update mesh vertex data in GPU for a specific buffer index
sourcepub fn export(&self, file_name: &str) -> bool
pub fn export(&self, file_name: &str) -> bool
Export mesh data to file, returns true on success
sourcepub fn get_bounding_box(&self) -> BoundingBox
pub fn get_bounding_box(&self) -> BoundingBox
Compute mesh bounding box limits
sourcepub fn generate_tangents(&mut self)
pub fn generate_tangents(&mut self)
Compute mesh tangents
sourcepub fn generate_polygon(sides: u32, radius: f32) -> Self
pub fn generate_polygon(sides: u32, radius: f32) -> Self
Generate polygonal mesh
sourcepub fn generate_plane(width: f32, length: f32, res_x: u32, res_z: u32) -> Self
pub fn generate_plane(width: f32, length: f32, res_x: u32, res_z: u32) -> Self
Generate plane mesh (with subdivisions)
sourcepub fn generate_cube(width: f32, height: f32, length: f32) -> Self
pub fn generate_cube(width: f32, height: f32, length: f32) -> Self
Generate cuboid mesh
sourcepub fn generate_sphere(radius: f32, rings: u32, slices: u32) -> Self
pub fn generate_sphere(radius: f32, rings: u32, slices: u32) -> Self
Generate sphere mesh (standard sphere)
sourcepub fn generate_hemisphere(radius: f32, rings: u32, slices: u32) -> Self
pub fn generate_hemisphere(radius: f32, rings: u32, slices: u32) -> Self
Generate half-sphere mesh (no bottom cap)
sourcepub fn generate_cylinder(radius: f32, height: f32, slices: u32) -> Self
pub fn generate_cylinder(radius: f32, height: f32, slices: u32) -> Self
Generate cylinder mesh
sourcepub fn generate_cone(radius: f32, height: f32, slices: u32) -> Self
pub fn generate_cone(radius: f32, height: f32, slices: u32) -> Self
Generate cone/pyramid mesh
sourcepub fn generate_torus(radius: f32, size: f32, rad_seg: u32, sides: u32) -> Self
pub fn generate_torus(radius: f32, size: f32, rad_seg: u32, sides: u32) -> Self
Generate torus mesh
sourcepub fn generate_knot(radius: f32, size: f32, rad_seg: u32, sides: u32) -> Self
pub fn generate_knot(radius: f32, size: f32, rad_seg: u32, sides: u32) -> Self
Generate trefoil knot mesh
sourcepub fn generate_heightmap(heightmap: &Image, size: Vector3) -> Self
pub fn generate_heightmap(heightmap: &Image, size: Vector3) -> Self
Generate heightmap mesh from image data
sourcepub fn generate_cubicmap(cubicmap: &Image, cube_size: Vector3) -> Self
pub fn generate_cubicmap(cubicmap: &Image, cube_size: Vector3) -> Self
Generate cubes-based map mesh from image data
Trait Implementations§
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§
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