2019-04-29 20:37:19 +00:00
|
|
|
use specs::{Component, FlaggedStorage, NullStorage, VecStorage};
|
2019-01-02 19:22:01 +00:00
|
|
|
use vek::*;
|
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
// Position
|
2019-01-02 19:22:01 +00:00
|
|
|
|
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-05-13 13:58:01 +00:00
|
|
|
type Storage = VecStorage<Self>;
|
2019-01-02 19:22:01 +00:00
|
|
|
}
|
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
// Velocity
|
2019-01-02 19:22:01 +00:00
|
|
|
|
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-05-13 13:58:01 +00:00
|
|
|
type Storage = VecStorage<Self>;
|
2019-01-02 19:22:01 +00:00
|
|
|
}
|
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
// Direction
|
2019-01-02 19:22:01 +00:00
|
|
|
|
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-05-13 13:58:01 +00:00
|
|
|
type Storage = VecStorage<Self>;
|
2019-03-05 00:00:11 +00:00
|
|
|
}
|
2019-04-14 20:30:27 +00:00
|
|
|
|
2019-05-17 20:47:58 +00:00
|
|
|
// ForceUpdate
|
2019-04-14 20:30:27 +00:00
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)]
|
|
|
|
pub struct ForceUpdate;
|
|
|
|
|
|
|
|
impl Component for ForceUpdate {
|
|
|
|
type Storage = NullStorage<Self>;
|
|
|
|
}
|