gizmo-physics 0.1.0

A custom ECS and physics engine aimed for realistic simulations.
Documentation
use gizmo_math::Vec3;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct Velocity {
    pub linear: Vec3,
    pub angular: Vec3,
}

impl Velocity {
    pub fn new(linear: Vec3) -> Self {
        Self {
            linear,
            angular: Vec3::ZERO,
        }
    }

    pub fn with_angular(mut self, angular: Vec3) -> Self {
        self.angular = angular;
        self
    }
}

impl Default for Velocity {
    fn default() -> Self {
        Self::new(Vec3::ZERO)
    }
}

gizmo_core::impl_component!(Velocity);