diff options
author | sanine-a <sanine.not@pm.me> | 2023-04-14 15:55:34 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2023-04-14 15:55:34 -0500 |
commit | 704614fde1a9062fa613b3b8646ee8108ccfb219 (patch) | |
tree | ca853e6dfc6a6b9a72de9d2193bf369eda4feaf9 /honey | |
parent | 01a8b2a3d98f816b8b712a974f3d1e98f05152f5 (diff) |
add physics linear/angular velocity tracking
Diffstat (limited to 'honey')
-rw-r--r-- | honey/ecs-systems.lua | 5 |
1 files changed, 5 insertions, 0 deletions
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, |