#pragma once

#include "math/float_types.hpp"
#include "math/math.hpp"

namespace physics {

  struct particle
  {
    vec3 position;
    vec3 velocity;
    vec3 acceleration;
    float damping;
    float inverse_mass;
    vec3 force_accum;

    void integrate(float duration);

    inline void add_force(const vec3& force)
    {
      force_accum += force;
    }

    inline float get_mass() const
    {
      float sqrt_mass = 1.0f / sqrt<float>(inverse_mass);
      return sqrt_mass * sqrt_mass;
    }
  };
}
