From 704614fde1a9062fa613b3b8646ee8108ccfb219 Mon Sep 17 00:00:00 2001
From: sanine-a <sanine.not@pm.me>
Date: Fri, 14 Apr 2023 15:55:34 -0500
Subject: add physics linear/angular velocity tracking

---
 honey/ecs-systems.lua | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'honey')

diff --git a/honey/ecs-systems.lua b/honey/ecs-systems.lua
index 969b6fe..418f312 100644
--- a/honey/ecs-systems.lua
+++ b/honey/ecs-systems.lua
@@ -271,6 +271,11 @@ physics = function(params)
 						:identity()
 						:translate(Vec3{x,y,z})
 						:mul(Quaternion{a,b,c,d}:toMat4())
+
+					local vel = physics.velocity
+					vel[1], vel[2], vel[3] = ode.BodyGetLinearVel(physics._body)
+					local avel = physics.angularVelocity
+					avel[1], avel[2], avel[3] = ode.BodyGetAngularVel(physics._body)
 				end
 			end
 		end,
-- 
cgit v1.2.1