pub enum MeshRef {
Procedural {
kind: ProceduralMeshKind,
params: [f32; 4],
uuid: AssetUUID,
},
Asset(AssetUUID),
}Expand description
Authored reference to a mesh — the only serialized mesh form.
The enum is the discriminator: Procedural carries the primitive kind
and its generator parameters; Asset carries the stable UUID of an
imported mesh in the VFS.
Both arms carry an identity UUID — the content-derived UUID for
Procedural, the stable asset UUID for Asset. The resolver compares this
against the resolved handle’s UUID every tick: a mismatch (or a missing
handle) means the authored reference changed and must be re-resolved. The
Procedural UUID is never serialized; it is recomputed from kind +
params on deserialize via MeshRef::procedural so it stays purely
content-derived. Construct Procedural through MeshRef::procedural so
the UUID and the parameters can never disagree.
Variants§
Procedural
Procedural primitive — rebuilt from kind + params by the resolver.
The uuid is content-derived; build via MeshRef::procedural.
Fields
kind: ProceduralMeshKindWhich procedural primitive to regenerate.
uuid: AssetUUIDContent-derived identity UUID. Not serialized — recomputed on load.
Asset(AssetUUID)
Reference to an imported mesh asset in the VFS, resolved by UUID.
Implementations§
Source§impl MeshRef
impl MeshRef
Sourcepub fn procedural(kind: ProceduralMeshKind, params: [f32; 4]) -> Self
pub fn procedural(kind: ProceduralMeshKind, params: [f32; 4]) -> Self
Builds a Procedural reference, deriving its identity UUID from the
primitive kind discriminant plus the raw parameter bytes. Identical
procedural meshes get the same UUID, so they dedup to one resolved
handle (and one GpuMesh). This is the SAME content hash the GPU
projection keys on.
Trait Implementations§
Source§impl Component for MeshRef
impl Component for MeshRef
Source§fn make_column() -> Box<dyn AnyVec>where
Self: Sized,
fn make_column() -> Box<dyn AnyVec>where
Self: Sized,
Vec<Self>.Source§fn push_into_column(self, column: &mut dyn AnyVec)where
Self: Sized,
fn push_into_column(self, column: &mut dyn AnyVec)where
Self: Sized,
self as a new row into its column. Read moreSource§fn copy_row_between(src: &dyn AnyVec, src_row: usize, dst: &mut dyn AnyVec)where
Self: Sized,
fn copy_row_between(src: &dyn AnyVec, src_row: usize, dst: &mut dyn AnyVec)where
Self: Sized,
src_row from src into dst (used when an entity migrates
between pages on a structural change). Both columns are this component’s
column type. Read moreSource§fn clone_from_column(column: &dyn AnyVec, row: usize) -> Selfwhere
Self: Sized,
fn clone_from_column(column: &dyn AnyVec, row: usize) -> Selfwhere
Self: Sized,
row of column as an owned value — the uniform by-value
access path that works for both AoS (clone the &T) and field-SoA
(gather the fields) layouts. Used by World::clone_component, the
Soa<T> query, and the serialization recipe. Read moreimpl StructuralPartialEq for MeshRef
Auto Trait Implementations§
impl Freeze for MeshRef
impl RefUnwindSafe for MeshRef
impl Send for MeshRef
impl Sync for MeshRef
impl Unpin for MeshRef
impl UnsafeUnpin for MeshRef
impl UnwindSafe for MeshRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C1> ComponentBundle for C1where
C1: Component,
impl<C1> ComponentBundle for C1where
C1: Component,
Source§fn type_ids() -> Vec<TypeId>
fn type_ids() -> Vec<TypeId>
TypeIds for the components in this bundle. Read moreSource§fn create_columns() -> HashMap<TypeId, Box<dyn AnyVec>>
fn create_columns() -> HashMap<TypeId, Box<dyn AnyVec>>
Vec<T> columns required to store
this bundle’s components. Read moreSource§fn update_metadata(
metadata: &mut EntityMetadata,
location: PageIndex,
registry: &ComponentRegistry,
)
fn update_metadata( metadata: &mut EntityMetadata, location: PageIndex, registry: &ComponentRegistry, )
EntityMetadata struct to point
to the location of this bundle’s data. Read moreSource§unsafe fn add_to_page(self, page: &mut ComponentPage)
unsafe fn add_to_page(self, page: &mut ComponentPage)
ComponentPage. Read more