Enum MeshRef
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.
Asset(AssetUUID)
Reference to an imported mesh asset in the VFS, resolved by UUID.
Implementations§
§impl MeshRef
impl MeshRef
pub fn procedural(kind: ProceduralMeshKind, params: [f32; 4]) -> MeshRef
pub fn procedural(kind: ProceduralMeshKind, params: [f32; 4]) -> MeshRef
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§
§impl Component for MeshRef
impl Component for MeshRef
§fn make_column() -> Box<dyn AnyVec>where
Self: Sized,
fn make_column() -> Box<dyn AnyVec>where
Self: Sized,
Vec<Self>.§fn push_into_column(self, column: &mut (dyn AnyVec + 'static))where
Self: Sized,
fn push_into_column(self, column: &mut (dyn AnyVec + 'static))where
Self: Sized,
self as a new row into its column. Read more§fn copy_row_between(
src: &(dyn AnyVec + 'static),
src_row: usize,
dst: &mut (dyn AnyVec + 'static),
)where
Self: Sized,
fn copy_row_between(
src: &(dyn AnyVec + 'static),
src_row: usize,
dst: &mut (dyn AnyVec + 'static),
)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 more§fn clone_from_column(column: &(dyn AnyVec + 'static), row: usize) -> Selfwhere
Self: Sized,
fn clone_from_column(column: &(dyn AnyVec + 'static), 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 more§fn set_in_column(self, column: &mut (dyn AnyVec + 'static), row: usize)where
Self: Sized,
fn set_in_column(self, column: &mut (dyn AnyVec + 'static), row: usize)where
Self: Sized,
row of column with self — the uniform by-value write
path for both layouts (AoS assigns the slot; field-SoA scatters into the
lanes). Used by World::set_component. 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§
§impl<T> AppLifecycle for Twhere
T: ?Sized,
impl<T> AppLifecycle for Twhere
T: ?Sized,
§fn on_start(&mut self, ctx: &mut dyn AppContext)
fn on_start(&mut self, ctx: &mut dyn AppContext)
update. Apps install their theme / fonts here.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,
§impl<C1> ComponentBundle for C1where
C1: Component,
impl<C1> ComponentBundle for C1where
C1: Component,
§fn type_ids() -> Vec<TypeId>
fn type_ids() -> Vec<TypeId>
TypeIds for the components in this bundle. Read more§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 more§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 more§unsafe fn add_to_page(self, page: &mut ComponentPage)
unsafe fn add_to_page(self, page: &mut ComponentPage)
ComponentPage. Read more§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.