--- /dev/null
+#ifndef GONG_PHYSICS_DERIVATIVE_HPP_
+#define GONG_PHYSICS_DERIVATIVE_HPP_
+
+#include "../graphics/glm.hpp"
+
+#include <glm/gtc/quaternion.hpp>
+
+
+namespace gong {
+namespace physics {
+
+struct State;
+
+
+struct Derivative {
+
+ glm::vec3 dpos;
+ glm::vec3 dlin;
+ glm::quat dorient;
+ glm::vec3 dang;
+
+ Derivative() noexcept;
+ Derivative(
+ const glm::vec3 &,
+ const glm::vec3 &,
+ const glm::quat &,
+ const glm::vec3 &
+ ) noexcept;
+
+};
+
+
+inline Derivative operator +(const Derivative &a, const Derivative &b) noexcept {
+ return Derivative(a.dpos + b.dpos, a.dlin + b.dlin, a.dorient * b.dorient, a.dang + b.dang);
+}
+
+inline Derivative operator *(float f, const Derivative &d) noexcept {
+ return Derivative(f * d.dpos, f * d.dlin, f * d.dorient, f * d.dang);
+}
+inline Derivative operator *(const Derivative &d, float f) noexcept {
+ return f * d;
+}
+
+State &operator +=(State &s, const Derivative &d) noexcept;
+
+}
+}
+
+#endif