pub struct MeshRenderer {
pub mesh: Option<MeshHandle>,
pub material: Option<MaterialHandle>,
pub texture: Option<TextureHandle>,
pub cull_distance: f32,
}Expand description
Single-mesh render description for an entity: which mesh, material, and optional legacy texture to draw, plus an optional view-distance cutoff.
Runtime-only. Mutually exclusive with ModelRenderer on an entity (an
entity has one or the other), which encodes the mesh-vs-model choice a
Prop expresses with its model field taking precedence.
Fields§
§mesh: Option<MeshHandle>A Mesh or ProceduralMesh to render, addressed by its shared
mesh-source handle.
material: Option<MaterialHandle>A Material providing albedo plus lighting parameters, addressed by its
MaterialHandle.
texture: Option<TextureHandle>Legacy texture, used only when material is unset.
cull_distance: f32View-distance cutoff in world units; 0 keeps the draw visible at any distance.
Trait Implementations§
Source§impl Clone for MeshRenderer
impl Clone for MeshRenderer
Source§fn clone(&self) -> MeshRenderer
fn clone(&self) -> MeshRenderer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Component for MeshRenderer
impl Component for MeshRenderer
Source§const NAME: &'static str = "MeshRenderer"
const NAME: &'static str = "MeshRenderer"
The registry name a world authors this component under.
Source§fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
Reconstruct this component from a blob record, whose bytes are the
serialized runtime component (cook already ran the asset -> component
translation). The default rejects: runtime-only components are never
stored in a blob, so only loadable types provide an implementation.
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Called after construction to inject the payload locator from the blob def.
Only meaningful for components with a compiled payload.
The default implementation does nothing (correct for most components).
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Called after construction to inject the asset’s identity from the blob
def. Only meaningful for components that look themselves up by id at
runtime. The default implementation does nothing.
Source§impl ComponentSlot for MeshRenderer
impl ComponentSlot for MeshRenderer
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
The component type’s stable id, used as its
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<Self>
fn slot(s: &ComponentStorage) -> &Column<Self>
Borrow this type’s column out of the storage.
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
Mutably borrow this type’s column out of the storage.
Source§impl Debug for MeshRenderer
impl Debug for MeshRenderer
Source§impl Default for MeshRenderer
impl Default for MeshRenderer
Source§fn default() -> MeshRenderer
fn default() -> MeshRenderer
Returns the “default value” for a type. Read more
Source§impl From<MeshRenderer> for ComponentAsset
impl From<MeshRenderer> for ComponentAsset
Source§fn from(c: MeshRenderer) -> Self
fn from(c: MeshRenderer) -> Self
Converts to this type from the input type.
impl RuntimeComponent for MeshRenderer
Auto Trait Implementations§
impl Freeze for MeshRenderer
impl RefUnwindSafe for MeshRenderer
impl Send for MeshRenderer
impl Sync for MeshRenderer
impl Unpin for MeshRenderer
impl UnsafeUnpin for MeshRenderer
impl UnwindSafe for MeshRenderer
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
Mutably borrows from an owned value. Read more