2020-07-06 14:23:08 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2021-01-07 20:25:12 +00:00
|
|
|
use specs::{Component, DerefFlaggedStorage};
|
2020-07-06 05:56:02 +00:00
|
|
|
use specs_idvs::IdvStorage;
|
2019-07-29 19:54:58 +00:00
|
|
|
use vek::*;
|
2019-07-21 16:50:13 +00:00
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct LightEmitter {
|
|
|
|
pub col: Rgb<f32>,
|
|
|
|
pub strength: f32,
|
2020-05-04 15:15:31 +00:00
|
|
|
pub flicker: f32,
|
|
|
|
pub animated: bool,
|
2019-07-21 16:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for LightEmitter {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
col: Rgb::one(),
|
2019-07-25 20:51:20 +00:00
|
|
|
strength: 1.0,
|
2020-05-04 15:15:31 +00:00
|
|
|
flicker: 0.0,
|
|
|
|
animated: false,
|
2019-07-21 16:50:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for LightEmitter {
|
2021-01-07 20:25:12 +00:00
|
|
|
type Storage = DerefFlaggedStorage<Self, IdvStorage<Self>>;
|
2019-07-21 16:50:13 +00:00
|
|
|
}
|
2020-05-04 15:15:31 +00:00
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct LightAnimation {
|
|
|
|
pub offset: Vec3<f32>,
|
|
|
|
pub col: Rgb<f32>,
|
|
|
|
pub strength: f32,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for LightAnimation {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
offset: Vec3::zero(),
|
|
|
|
col: Rgb::zero(),
|
|
|
|
strength: 0.0,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for LightAnimation {
|
2021-01-07 20:25:12 +00:00
|
|
|
type Storage = IdvStorage<Self>;
|
2020-05-04 15:15:31 +00:00
|
|
|
}
|