pub struct BlockType {
pub asset_id: AssetId,
pub solid: bool,
pub uv_min: [f32; 2],
pub uv_max: [f32; 2],
pub uv_top: Option<[f32; 4]>,
pub uv_bottom: Option<[f32; 4]>,
pub uv_side: Option<[f32; 4]>,
}Expand description
Describes one entry in a VoxelChunk palette.
Each BlockType represents either a solid block (with UVs into the chunk’s atlas texture) or an empty/air marker.
Per-face fields fall back to uv_min/uv_max when omitted. Set solid=false
on the air/empty palette entry; faces between solid blocks and air blocks are
the only faces the chunk emits.
BlockType {
solid: false,
..Default::default()
};Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args. Lets the
runtime resolve a VoxelWorld palette (a list of BlockType ids) back
to the block data the chunk generator needs.
solid: boolWhen false the block is treated as air – no faces are emitted for it and it does not occlude neighboring faces.
uv_min: [f32; 2]Default atlas UV at the (0,0) corner of each face.
uv_max: [f32; 2]Default atlas UV at the (1,1) corner of each face.
uv_top: Option<[f32; 4]>Optional per-face override for the +Y face: [u_min, v_min, u_max, v_max].
uv_bottom: Option<[f32; 4]>Optional per-face override for the -Y face.
uv_side: Option<[f32; 4]>Optional per-face override applied to all four side faces (±X, ±Z).
Trait Implementations§
Source§impl Component for BlockType
impl Component for BlockType
Source§const NAME: &'static str = "BlockType"
const NAME: &'static str = "BlockType"
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Source§fn from_baked(bytes: &[u8]) -> Result<BlockType, CnResult>
fn from_baked(bytes: &[u8]) -> Result<BlockType, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§impl ComponentSlot for BlockType
impl ComponentSlot for BlockType
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§impl<'de> Deserialize<'de> for BlockType
impl<'de> Deserialize<'de> for BlockType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlockType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlockType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl RuntimeComponent for BlockType
Source§impl Serialize for BlockType
impl Serialize for BlockType
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 BlockType
impl RefUnwindSafe for BlockType
impl Send for BlockType
impl Sync for BlockType
impl Unpin for BlockType
impl UnsafeUnpin for BlockType
impl UnwindSafe for BlockType
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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 more