From 4b2507b2f30d50c8673f33179c2b537ac83da3bf Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 16 May 2023 22:51:17 -0500 Subject: add basic collision geom visualizations --- main.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 6d997cb..2542910 100644 --- a/main.lua +++ b/main.lua @@ -11,7 +11,7 @@ local systems = honey.ecs.SystemDb(db) local space = honey.ode.HashSpaceCreate(honey.ode.Space0) systems:addSystems(honey.ecs.node.system) -systems:addSystems(honey.ecs.render.system) +systems:addSystems(honey.ecs.render.system, {drawGeoms=true}) systems:addSystems(honey.ecs.script.system) systems:addSystems(honey.ecs.collision.system, { space=space }) @@ -20,7 +20,7 @@ db:createEntityWithComponents{ node = { matrix = Mat4() :identity() - :translate(Vec3{0,0,10}), + :translate(Vec3{0,0,4}), }, camera = { projection = Mat4() @@ -66,6 +66,15 @@ db:createEntityWithComponents{ }, shader = { vertex="vertex.glsl", fragment="fragment.glsl" }, }, + collision = { + class = "capsule", + radius = 1, + length = 2, + lx = 2, + ly = 2, + lz = 2, + }, + script = { script = "scripts.rotate" }, } honey.loop(function(dt) -- cgit v1.2.1