2019-04-14 20:30:27 +00:00
|
|
|
use specs::{Component, VecStorage, FlaggedStorage, NullStorage};
|
2019-01-02 19:22:01 +00:00
|
|
|
use vek::*;
|
|
|
|
|
|
|
|
// Pos
|
|
|
|
|
2019-03-04 19:50:26 +00:00
|
|
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
2019-01-02 19:22:01 +00:00
|
|
|
pub struct Pos(pub Vec3<f32>);
|
|
|
|
|
|
|
|
impl Component for Pos {
|
2019-04-10 17:23:27 +00:00
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
2019-01-02 19:22:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Vel
|
|
|
|
|
2019-03-04 19:50:26 +00:00
|
|
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
2019-01-02 19:22:01 +00:00
|
|
|
pub struct Vel(pub Vec3<f32>);
|
|
|
|
|
|
|
|
impl Component for Vel {
|
2019-04-10 17:23:27 +00:00
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
2019-01-02 19:22:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Dir
|
|
|
|
|
2019-03-04 19:50:26 +00:00
|
|
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
2019-01-02 19:22:01 +00:00
|
|
|
pub struct Dir(pub Vec3<f32>);
|
|
|
|
|
|
|
|
impl Component for Dir {
|
2019-04-10 17:23:27 +00:00
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
2019-03-05 00:00:11 +00:00
|
|
|
}
|
2019-04-14 20:30:27 +00:00
|
|
|
|
|
|
|
// Dir
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)]
|
|
|
|
pub struct ForceUpdate;
|
|
|
|
|
|
|
|
impl Component for ForceUpdate {
|
|
|
|
type Storage = NullStorage<Self>;
|
|
|
|
}
|