--- /dev/null
+#ifndef GONG_PHYSICS_STATE_HPP_
+#define GONG_PHYSICS_STATE_HPP_
+
+#include "../graphics/glm.hpp"
+
+#include <glm/gtc/quaternion.hpp>
+
+
+namespace gong {
+namespace physics {
+
+struct State {
+ /// position of center of mass
+ glm::vec3 pos;
+ /// linear momentum
+ glm::vec3 lin;
+ /// orientation
+ glm::quat orient;
+ /// angular momentum
+ glm::vec3 ang;
+ /// angular velocity as quat
+ glm::quat Spin() const noexcept {
+ return 0.5f * glm::quat(0.0f, ang * inverse_inertia) * orient;
+ }
+ float mass;
+ /// 1/mass
+ float inverse_mass;
+ /// rotational inertia
+ float inertia;
+ /// 1/inertia
+ float inverse_inertia;
+};
+
+}
+}
+
+#endif