pub struct GlassPanel {
pub asset_id: AssetId,
pub centre: [f32; 3],
pub normal: [f32; 3],
pub half_size: [f32; 2],
pub tint: [f32; 3],
pub opacity: f32,
pub refraction_strength: f32,
pub fresnel_power: f32,
pub visible: bool,
}Expand description
A flat translucent panel of coloured glass. A fixed-orientation rectangular quad that refracts and tints the scene behind it and brightens the grazing-angle rim with a Fresnel highlight.
Unlike WaterSurface it has no animation, no surface displacement, and no depth-based colour. It’s a simple building block for translucent surfaces such as windows, ice, holograms, or force fields.
The panel is positioned by centre, oriented by normal (the facing
direction), and sized by half_size (half-width along the panel’s tangent,
half-height along its bitangent).
GlassPanel {
centre: [0.0, 2.0, -3.0],
normal: [0.0, 0.0, 1.0],
half_size: [2.0, 1.5],
tint: [0.6, 0.85, 0.9],
opacity: 0.45,
refraction_strength: 0.04,
..Default::default()
};Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
centre: [f32; 3]World-space position of the panel’s centre.
normal: [f32; 3]Facing direction of the panel. Normalised on load; defaults to +Z when degenerate.
half_size: [f32; 2]Half-width and half-height of the panel, in world units.
tint: [f32; 3]Linear-space RGB colour the glass tints the scene behind it.
opacity: f32How opaque the glass is, in [0, 1]. 0 = clear, 1 = fully opaque tint.
refraction_strength: f32How strongly the glass bends the view of what’s behind it. 0 = no refraction.
fresnel_power: f32Sharpness of the grazing-angle rim highlight. Higher values confine the brightening to steeper viewing angles.
visible: boolWhen false the panel is skipped each frame.
Trait Implementations§
Source§impl Clone for GlassPanel
impl Clone for GlassPanel
Source§fn clone(&self) -> GlassPanel
fn clone(&self) -> GlassPanel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for GlassPanel
impl Component for GlassPanel
Source§const NAME: &'static str = "GlassPanel"
const NAME: &'static str = "GlassPanel"
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Source§fn from_baked(bytes: &[u8]) -> Result<GlassPanel, CnResult>
fn from_baked(bytes: &[u8]) -> Result<GlassPanel, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§impl ComponentSlot for GlassPanel
impl ComponentSlot for GlassPanel
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<GlassPanel>
fn slot(s: &ComponentStorage) -> &Column<GlassPanel>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<GlassPanel>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<GlassPanel>
Source§impl Debug for GlassPanel
impl Debug for GlassPanel
Source§impl Default for GlassPanel
impl Default for GlassPanel
Source§fn default() -> GlassPanel
fn default() -> GlassPanel
Source§impl<'de> Deserialize<'de> for GlassPanelwhere
GlassPanel: Default,
impl<'de> Deserialize<'de> for GlassPanelwhere
GlassPanel: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GlassPanel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GlassPanel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<GlassPanel> for ComponentAsset
impl From<GlassPanel> for ComponentAsset
Source§fn from(c: GlassPanel) -> ComponentAsset
fn from(c: GlassPanel) -> ComponentAsset
Source§impl GlassPanelGeometry for GlassPanel
impl GlassPanelGeometry for GlassPanel
Source§fn unit_normal(&self) -> [f32; 3]
fn unit_normal(&self) -> [f32; 3]
Unit-length facing direction, falling back to +Z when the authored
normal is degenerate. The build-time quad generator and the runtime
shader both rely on a usable normal.
impl RuntimeComponent for GlassPanel
Source§impl Serialize for GlassPanel
impl Serialize for GlassPanel
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 GlassPanel
impl RefUnwindSafe for GlassPanel
impl Send for GlassPanel
impl Sync for GlassPanel
impl Unpin for GlassPanel
impl UnsafeUnpin for GlassPanel
impl UnwindSafe for GlassPanel
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
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().