pub struct Room {
pub asset_id: AssetId,
pub half_width: f32,
pub half_depth: f32,
pub ceiling_height: f32,
pub texture: Option<TextureHandle>,
pub wall_texture: Option<TextureHandle>,
pub floor_texture: Option<TextureHandle>,
pub ceiling_texture: Option<TextureHandle>,
pub locator: Option<PayloadLocator>,
}Expand description
A self-contained room (floor, ceiling, four walls), with optional texturing.
Prefer Room over a ProceduralMesh (generator "room") +
Prop pair for a shorter declaration. The room is placed at the world
origin.
Dimensions can be given as size: [width, depth, height] (full extents) or
as half_width, half_depth, and ceiling_height individually.
texture, wall_texture, floor_texture, and ceiling_texture are checked
in that order; the first set value wins. Generator names such as "brick" or
"concrete" resolve to a matching Texture at build time.
Fields§
§asset_id: AssetIdAssigned by the loader; not authored.
half_width: f32Half the room’s width in world units.
half_depth: f32Half the room’s depth in world units.
ceiling_height: f32Floor-to-ceiling height in world units.
texture: Option<TextureHandle>Texture applied to every surface unless a surface overrides it.
wall_texture: Option<TextureHandle>Texture for the four walls.
floor_texture: Option<TextureHandle>Texture for the floor.
ceiling_texture: Option<TextureHandle>Texture for the ceiling.
locator: Option<PayloadLocator>The generated geometry’s place in the blob, injected at load.
Implementations§
Source§impl Room
impl Room
Sourcepub fn effective_texture(&self) -> Option<TextureHandle>
pub fn effective_texture(&self) -> Option<TextureHandle>
Returns the first set texture reference across all texture fields.
Trait Implementations§
Source§impl Component for Room
impl Component for Room
Source§fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Source§fn inject_locator(&mut self, locator: PayloadLocator)
fn inject_locator(&mut self, locator: PayloadLocator)
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Source§impl ComponentSlot for Room
impl ComponentSlot for Room
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.