veloren/common/src/comp/phys.rs

35 lines
774 B
Rust
Raw Normal View History

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