diff options
Diffstat (limited to 'honey')
-rw-r--r-- | honey/ecs/collision.lua | 6 | ||||
-rw-r--r-- | honey/ecs/render.lua | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/honey/ecs/collision.lua b/honey/ecs/collision.lua index b385e76..54598cb 100644 --- a/honey/ecs/collision.lua +++ b/honey/ecs/collision.lua @@ -59,7 +59,7 @@ local function updateGeom(collision) elseif class == "cylinder" then ode.GeomCylinderSetParams(geom, collision.radius, collision.length) elseif class == "ray" then - GeomRaySetLength(geom, collision.length) + ode.GeomRaySetLength(geom, collision.length) end end @@ -121,8 +121,8 @@ local updateTransform = ecs.System("collisionTransform", function(db, dt, p) local collisions = ode.Collide(geomA, geomB, p.maxPoints or 1) if #collisions > 0 then -- get entity ids - local idA = ode.GetData(geomA) - local idB = ode.GetData(geomB) + local idA = ode.GeomGetData(geomA) + local idB = ode.GeomGetData(geomB) -- run handlers, if any runCollisionScript(db, idA, idB, collisions) diff --git a/honey/ecs/render.lua b/honey/ecs/render.lua index 1c38692..8ee6e8f 100644 --- a/honey/ecs/render.lua +++ b/honey/ecs/render.lua @@ -123,6 +123,7 @@ local function drawGeoms(db, view, projection) drawMesh(program, uniforms, matrices, vao, count) elseif tbl.class == "ray" then m:scale(Vec3{0.001, 0.001, tbl.length}) + :translate(Vec3{0, 0, 1/2}) local vao, count = mesh.get("builtin.cube", 1) drawMesh(program, uniforms, matrices, vao, count) end |