pub struct Mesh3d {
pub mesh: Mesh,
/* private fields */
}Expand description
Construct once and draw many times. Mesh dimensions are baked into vertices; draw transforms use only rotation/translation to keep normals correct.
Fields§
§mesh: MeshImplementations§
Source§impl Mesh3d
impl Mesh3d
pub fn from_mesh(mesh: Mesh) -> Mesh3d
Sourcepub fn invalidate_gpu(&mut self)
pub fn invalidate_gpu(&mut self)
Invalidate the GPU snapshot after editing the public source mesh.
pub fn resident(&self) -> &ResidentMesh
pub fn draw_transformed(&self, model: Mat4)
Sourcepub fn draw_immediate(&self, model: Mat4)
pub fn draw_immediate(&self, model: Mat4)
CPU path for geometry whose exact submission order must be preserved.
Sourcepub fn plane(size: Vec2, color: Color, subdivisions: u16) -> Mesh3d
pub fn plane(size: Vec2, color: Color, subdivisions: u16) -> Mesh3d
Tessellated XZ ground plane centered at the origin, facing positive Y. Subdivision provides nearby vertices for vertex lighting/distance fog on large surfaces. Bounded to 1..=28 cells per side to keep low-poly scenes inexpensive.
Sourcepub fn cylinder(radius: f32, height: f32, color: Color, segments: u16) -> Mesh3d
pub fn cylinder(radius: f32, height: f32, color: Color, segments: u16) -> Mesh3d
Flat-shaded, capped cylinder along Y. Construct once and reuse for props.
Sourcepub fn cone(radius: f32, height: f32, color: Color, segments: u16) -> Mesh3d
pub fn cone(radius: f32, height: f32, color: Color, segments: u16) -> Mesh3d
Flat-shaded cone along Y, with its tip at positive Y.
Sourcepub fn frustum(
bottom: f32,
top: f32,
height: f32,
color: Color,
segments: u16,
) -> Mesh3d
pub fn frustum( bottom: f32, top: f32, height: f32, color: Color, segments: u16, ) -> Mesh3d
Capped tapered prism; radii are at negative/positive Y respectively. Zero-radius caps are omitted. Tessellation is bounded to 3..=128 sides.
pub fn cuboid(size: Vec3, color: Color) -> Mesh3d
Sourcepub fn sphere(radius: f32, color: Color, segments: u16, rings: u16) -> Mesh3d
pub fn sphere(radius: f32, color: Color, segments: u16, rings: u16) -> Mesh3d
Faceted sphere. Latitude rings are bounded to retain a low-poly budget.