pub struct SkyRotation {
pub asset_id: AssetId,
pub axis: [f32; 3],
pub degrees_per_second: f32,
pub angle_deg: f32,
}Expand description
Turns the whole celestial sphere: the sky, the image-based lighting it casts, every DirectionalLight, and any Prop hung on it.
One per world. The rotation at elapsed time t is angle_deg + degrees_per_second * t about axis, taken in the sense a planet’s own
spin gives the sky: with the default axis a body rises from +Z, passes
overhead through +Y, and sets toward -Z.
The component’s own entity carries that rotation as its transform, so a
Prop naming this asset as its parent orbits with the sky. Reflection
probes are baked once and do not turn.
SkyRotation {
axis: [1.0, 0.0, 0.0],
degrees_per_second: 3.0,
..Default::default()
};Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
axis: [f32; 3]The celestial pole in world space: the axis the sphere turns about. Does not need to be normalised.
degrees_per_second: f32Turn rate in degrees per second. Negative runs the sky backwards.
angle_deg: f32The angle the sky starts at, in degrees.
Trait Implementations§
Source§impl Clone for SkyRotation
impl Clone for SkyRotation
Source§fn clone(&self) -> SkyRotation
fn clone(&self) -> SkyRotation
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 SkyRotation
impl Component for SkyRotation
Source§const NAME: &'static str = "SkyRotation"
const NAME: &'static str = "SkyRotation"
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Source§fn from_baked(bytes: &[u8]) -> Result<SkyRotation, CnResult>
fn from_baked(bytes: &[u8]) -> Result<SkyRotation, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§impl ComponentSlot for SkyRotation
impl ComponentSlot for SkyRotation
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<SkyRotation>
fn slot(s: &ComponentStorage) -> &Column<SkyRotation>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<SkyRotation>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<SkyRotation>
Source§impl Debug for SkyRotation
impl Debug for SkyRotation
Source§impl Default for SkyRotation
impl Default for SkyRotation
Source§fn default() -> SkyRotation
fn default() -> SkyRotation
Source§impl<'de> Deserialize<'de> for SkyRotationwhere
SkyRotation: Default,
impl<'de> Deserialize<'de> for SkyRotationwhere
SkyRotation: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SkyRotation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SkyRotation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<SkyRotation> for ComponentAsset
impl From<SkyRotation> for ComponentAsset
Source§fn from(c: SkyRotation) -> ComponentAsset
fn from(c: SkyRotation) -> ComponentAsset
impl RuntimeComponent for SkyRotation
Source§impl Serialize for SkyRotation
impl Serialize for SkyRotation
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 SkyRotation
impl RefUnwindSafe for SkyRotation
impl Send for SkyRotation
impl Sync for SkyRotation
impl Unpin for SkyRotation
impl UnsafeUnpin for SkyRotation
impl UnwindSafe for SkyRotation
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().