summaryrefslogtreecommitdiff
path: root/honey/ecs-systems.lua
diff options
context:
space:
mode:
Diffstat (limited to 'honey/ecs-systems.lua')
-rw-r--r--honey/ecs-systems.lua12
1 files changed, 1 insertions, 11 deletions
diff --git a/honey/ecs-systems.lua b/honey/ecs-systems.lua
index 418f312..54bac89 100644
--- a/honey/ecs-systems.lua
+++ b/honey/ecs-systems.lua
@@ -158,7 +158,7 @@ end
--===== physics =====--
physics = function(params)
- local interval = params.interval or 0.01
+ local interval = params.interval or 0.016
local groupSize = params.groupSize or 20
return {
db=params.db,
@@ -172,10 +172,6 @@ physics = function(params)
local query = self.db:queryComponent("physics")
for id, physics in pairs(query) do
if not physics._body then
- print("creating physics body for "..id)
- for k,v in pairs(physics) do
- print(k, v)
- end
physics._body = ode.BodyCreate(self.world)
physics._gc = honey.util.gc_canary(function()
print("releasing physics body for " .. id)
@@ -192,30 +188,24 @@ physics = function(params)
physics.mass.radius
)
end
- print('mass')
ode.BodySetMass(physics._body, mass)
local m = self.db:getComponent(id, "transform").matrix
- print(m)
- print('pos')
ode.BodySetPosition(
physics._body,
m[1][4], m[2][4], m[3][4]
)
- print('rot')
ode.BodySetRotation(
physics._body,
m[1][1], m[1][2], m[1][3],
m[2][1], m[2][2], m[2][3],
m[3][1], m[3][2], m[3][3]
)
- print('vel')
ode.BodySetLinearVel(
physics._body,
physics.velocity[1],
physics.velocity[2],
physics.velocity[3]
)
- print('lvel')
ode.BodySetAngularVel(
physics._body,
physics.angularVelocity[1],