pub struct Solidity {
pub bedrock_blocks: bool,
pub passable: Option<fn(VoxColor) -> bool>,
}Expand description
What counts as solid for a collision probe.
Fields§
§bedrock_blocks: boolDoes the voxlap bedrock placeholder (chunk-local
z = CHUNK_SIZE_Z - 1) block? Default false, matching the
demos’ treat_z_max_as_air rendering. Set true for worlds
whose bottom plane is genuinely solid ground rendered as
such — collision and rendering must agree, or the player
either hits an invisible wall or falls through a visible
floor.
passable: Option<fn(VoxColor) -> bool>The material hook (CC.4): a colour veto for visible voxels.
Some(f) makes a voxel whose colour f approves passable —
water, foliage, ladders — while everything else still blocks;
None (default) blocks on any voxel. A plain fn (not a
closure) so Solidity stays Copy; key it the way material
maps key their colours (compare .rgb_part(), ignore the
brightness byte — lighting bakes rewrite it).
Limitation, inherent to the voxlap slab format: hidden run
interiors (Cube::UnexposedSolid) store no colour and
always block. Rule of thumb: a
pass-through wall/curtain works up to 2 voxels thick
(every voxel still has an exposed face and carries its
colour); at 3+ a colourless core appears and blocks. Filled
pools are wade-through only near their visible surface. Also
keep such geometry at least 1 voxel away from chunk-local
x/y = 0 and the chunk’s far edge: the slab encoder treats
out-of-chunk neighbours as solid, so edge voxels lose their
side colours (they render, but classify as UnexposedSolid —
both facts are pinned in this module’s tests).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Solidity
impl RefUnwindSafe for Solidity
impl Send for Solidity
impl Sync for Solidity
impl Unpin for Solidity
impl UnsafeUnpin for Solidity
impl UnwindSafe for Solidity
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<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