diff options
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 34 |
1 files changed, 30 insertions, 4 deletions
@@ -48,11 +48,23 @@ db:createEntityWithComponents{ }, } + +local parent = db:createEntityWithComponents{ + node = { + matrix = Mat4() + :identity() + }, + script = { script = "scripts.update" }, +} + -- mesh db:createEntityWithComponents{ node = { + parent = parent, matrix = Mat4() - :identity(), + :identity() + :rotateX(0.5*math.pi) + :rotateZ(0.5*math.pi) }, renderMesh = { mesh = { @@ -67,14 +79,28 @@ db:createEntityWithComponents{ shader = { vertex="vertex.glsl", fragment="fragment.glsl" }, }, collision = { - class = "capsule", + class = "ray", radius = 1, - length = 2, + length = 4, lx = 2, ly = 2, lz = 2, }, - script = { script = "scripts.rotate" }, + onCollision = { script = "scripts.collide" }, +} + + +-- box? +db:createEntityWithComponents{ + node = { + matrix = Mat4() + :identity() + :translate(Vec3{0,-3,0}) + }, + collision = { + class = "box", + lx = 1, ly=1, lz=1, + }, } honey.loop(function(dt) |