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<Room, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Room, 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.Source§impl<'de> Deserialize<'de> for Room
impl<'de> Deserialize<'de> for Room
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Room, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Room, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<Room> for ComponentAsset
impl From<Room> for ComponentAsset
Source§fn from(c: Room) -> ComponentAsset
fn from(c: Room) -> ComponentAsset
impl RuntimeComponent for Room
Source§impl Serialize for Room
impl Serialize for Room
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 Room
impl RefUnwindSafe for Room
impl Send for Room
impl Sync for Room
impl Unpin for Room
impl UnsafeUnpin for Room
impl UnwindSafe for Room
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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