Skip to main content

Mesh3D

Struct Mesh3D 

Source
pub struct Mesh3D { /* private fields */ }
Expand description

Indexed triangle mesh with local AABB, Nanite-style meshlet clusters, and default PBR material.

Implementations§

Source§

impl Mesh3D

Mesh construction, Nanite-style meshlet clustering, decimation, and procedural asset generators for Mesh3D.

Source

pub fn build_meshlets_from_parts( vertices: &[Vertex3D], indices: &[[u32; 3]], ) -> Vec<Meshlet3D>

Partitions indexed triangles into Nanite-style Meshlet3D clusters with tight AABBs and normal cones.

§Arguments
  • &[Vertex3D] - Source vertex buffer.
  • &[[u32; 3]] - Source triangle indices.
§Returns
  • Vec<Meshlet3D> - Contiguous cluster descriptors covering all triangles.
Source

pub fn from_parts( name: String, vertices: Vec<Vertex3D>, indices: Vec<[u32; 3]>, material: PbrMaterial, ) -> Self

Constructs a Mesh3D, computes its local Aabb3D, and partitions Nanite-style Meshlet3D clusters.

§Arguments
  • String - Asset name.
  • Vec<Vertex3D> - Vertex list.
  • Vec<[u32; 3]> - Triangle indices.
  • PbrMaterial - Default material.
§Returns
  • Self - Ready indexed mesh with meshlets.
Source

pub fn box_mesh( name: &str, w: f32, h: f32, d: f32, ground_pivot: bool, material: PbrMaterial, ) -> Self

Generates an axis-aligned box mesh of dimensions (w, h, d) resting on y = 0 or centered.

§Arguments
  • &str - Mesh name.
  • f32 - Width along X.
  • f32 - Height along Y.
  • f32 - Depth along Z.
  • bool - When true, base rests on y = 0; otherwise centered at origin.
  • PbrMaterial - Surface PBR material.
§Returns
  • Self - Indexed 12-triangle box mesh with crisp flat face normals.
Source

pub fn ground_plane( name: &str, w: f32, d: f32, subdivisions: usize, material: PbrMaterial, ) -> Self

Generates a horizontal ground/road quad plane at y = 0 subdivided for crisp specular/shadow falloff.

§Arguments
  • &str - Mesh name.
  • f32 - Width along X.
  • f32 - Depth along Z.
  • usize - Grid subdivisions per axis.
  • PbrMaterial - Surface PBR material.
§Returns
  • Self - Subdivided ground plane mesh.
Source

pub fn sports_car(name: &str, material: PbrMaterial) -> Self

Generates a low-poly sculpted sports car chassis resting on y = 0.

§Arguments
  • &str - Asset name.
  • PbrMaterial - Car body paint PBR material.
§Returns
  • Self - Composite vehicle mesh.
Source

pub fn from_box_desc(desc: &BoxMeshDesc) -> Self

Builds a box mesh from a fluent BoxMeshDesc.

§Arguments
  • &BoxMeshDesc - Box mesh descriptor.
§Returns
  • Self - Indexed 12-triangle box mesh.
Source

pub fn from_ground_desc(desc: &GroundPlaneDesc) -> Self

Builds a subdivided ground plane from a fluent GroundPlaneDesc.

§Arguments
  • &GroundPlaneDesc - Ground plane descriptor.
§Returns
  • Self - Subdivided ground plane mesh.
Source

pub fn build_lod_proxy(&self, suffix: &str) -> Self

Builds a simplified proxy mesh enclosing this mesh’s AABB for distant LOD tiers.

§Arguments
  • &Self - Source mesh reference.
  • &str - LOD suffix label.
§Returns
  • Self - Lightweight 12-triangle LOD proxy mesh.
Source

pub fn build_mid_lod(&self, suffix: &str) -> Self

Produces a mid-detail decimated mesh by retaining dominant triangles while preserving bounding silhouette.

§Arguments
  • &Self - Source mesh reference.
  • &str - LOD suffix label.
§Returns
  • Self - Decimated intermediate LOD mesh.
Source§

impl Mesh3D

Source

pub fn get_name(&self) -> &String

Source

pub fn get_mut_name(&mut self) -> &mut String

Source

pub fn set_name(&mut self, val: String) -> &mut Self

Source

pub fn get_vertices(&self) -> &Vec<Vertex3D>

Source

pub fn get_mut_vertices(&mut self) -> &mut Vec<Vertex3D>

Source

pub fn set_vertices(&mut self, val: Vec<Vertex3D>) -> &mut Self

Source

pub fn get_indices(&self) -> &Vec<[u32; 3]>

Source

pub fn get_mut_indices(&mut self) -> &mut Vec<[u32; 3]>

Source

pub fn set_indices(&mut self, val: Vec<[u32; 3]>) -> &mut Self

Source

pub fn get_bounds(&self) -> Aabb3D

Source

pub fn get_mut_bounds(&mut self) -> &mut Aabb3D

Source

pub fn set_bounds(&mut self, val: Aabb3D) -> &mut Self

Source

pub fn get_material(&self) -> PbrMaterial

Source

pub fn get_mut_material(&mut self) -> &mut PbrMaterial

Source

pub fn set_material(&mut self, val: PbrMaterial) -> &mut Self

Source

pub fn get_meshlets(&self) -> &Vec<Meshlet3D>

Source

pub fn get_mut_meshlets(&mut self) -> &mut Vec<Meshlet3D>

Source

pub fn set_meshlets(&mut self, val: Vec<Meshlet3D>) -> &mut Self

Trait Implementations§

Source§

impl Clone for Mesh3D

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mesh3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Mesh3D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Mesh3D

Auto Trait Implementations§

§

impl Forget for Mesh3D

§

impl Freeze for Mesh3D

§

impl Move for Mesh3D

§

impl RefUnwindSafe for Mesh3D

§

impl Send for Mesh3D

§

impl Sync for Mesh3D

§

impl Unpin for Mesh3D

§

impl UnsafeUnpin for Mesh3D

§

impl UnwindSafe for Mesh3D

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.