veloren/common/src/comp/phys.rs

39 lines
790 B
Rust
Raw Normal View History

use specs::{Component, FlaggedStorage, NullStorage, VecStorage};
2019-01-02 19:22:01 +00:00
use vek::*;
// Pos
#[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 = FlaggedStorage<Self, VecStorage<Self>>;
2019-01-02 19:22:01 +00:00
}
// Vel
#[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 = FlaggedStorage<Self, VecStorage<Self>>;
2019-01-02 19:22:01 +00:00
}
// Dir
#[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 = FlaggedStorage<Self, VecStorage<Self>>;
}
// Dir
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)]
pub struct ForceUpdate;
impl Component for ForceUpdate {
type Storage = NullStorage<Self>;
}