veloren/common/src/comp/phys.rs

39 lines
750 B
Rust
Raw Normal View History

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