pub struct Mesh {
pub asset_id: AssetId,
pub source: String,
pub primitive_index: u32,
pub chunk_index: Option<u32>,
pub vertices: Vec<VertexData>,
pub indices: Vec<u16>,
pub lod_levels: u32,
pub lod_distances: Vec<f32>,
pub locator: Option<PayloadLocator>,
}Expand description
Raw geometry. Supply vertices and indices directly, or import them from
a binary glTF file with source + primitive_index.
Use when you want full control over shape: custom furniture, architectural details, signage, or any form a generator cannot produce. For standard shapes use ProceduralMesh.
Normals and tangents are computed automatically at build time. Do not supply normals or tangents.
Vertex color: use [0.75, 0.74, 0.72] for a neutral surface that takes
the material albedo, or [1, 1, 1] to pass through unmodified.
Winding: triangles must be counter-clockwise when viewed from the front. Reversed winding = invisible face.
Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
source: StringOptional path to a .glb file. When set, the build imports
vertices / indices from it; inline geometry leaves this empty.
primitive_index: u32Which primitive (counted across all meshes in the file) to import from
source. Ignored when source is empty.
chunk_index: Option<u32>Pick a single chunk of an oversized imported primitive. None (the
default) imports the whole primitive, which is fine whenever its vertex
count fits in 16-bit indices; larger primitives are split into chunks on
import, one Mesh per chunk.
vertices: Vec<VertexData>Vertex list. Each vertex: {"pos":[x,y,z], "color":[r,g,b], "uv":[u,v]}.
indices: Vec<u16>Triangle index list (16-bit values).
lod_levels: u32Number of level-of-detail versions to generate, including the original.
1 (the default) generates none; values are clamped to [1, 8].
lod_distances: Vec<f32>Camera distances at which to switch to each lower-detail version. Length
should be lod_levels - 1; empty lets the build derive a default
sequence. The version for index i is used at camera distance ≥
lod_distances[i].
locator: Option<PayloadLocator>Injected at load time from the compiled blob payload.
Trait Implementations§
impl BakedMesh for Mesh
Source§impl<'de> Deserialize<'de> for Mesh
impl<'de> Deserialize<'de> for Mesh
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Mesh, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Mesh, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl ResourceAsset for Mesh
Source§impl Serialize for Mesh
impl Serialize for Mesh
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Mesh
impl RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().