2019-01-02 19:22:01 +00:00
|
|
|
// Library
|
|
|
|
use specs::{Component, VecStorage};
|
|
|
|
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 {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|
2019-03-05 00:00:11 +00:00
|
|
|
|
|
|
|
// UpdateKind
|
2019-03-19 11:35:35 +00:00
|
|
|
|
2019-03-05 00:00:11 +00:00
|
|
|
#[derive(Copy, Clone, Debug)]
|
|
|
|
pub enum UpdateKind {
|
|
|
|
Passive,
|
|
|
|
Force,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for UpdateKind {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|