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<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§impl ComponentSlot for SkyRotation
impl ComponentSlot for SkyRotation
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.