Re: ISO
Posted: Sat Feb 18, 2012 8:44 pm
Maybe something more like this? (It's just a snippet, no example, but HC provides collisions for arbitrarily shaped polygons, so I made a long hexagon.)
EDIT:
Just tried to implement this into my little demo and am getting errors from HardonCollider.
Code: Select all
function makeGroundingBound(obj)
local r = obj.h / 4
return HC:addPolygon(
obj.x - r, obj.y + obj.h,
obj.x, obj.y + obj.h - r,
obj.x + obj.w, obj.y + obj.h - r,
obj.x + obj.w + r, obj.y + obj.h,
obj.x + obj.w, obj.y + obj.h + r,
obj.x, obj.y + r)
end
Just tried to implement this into my little demo and am getting errors from HardonCollider.
Code: Select all
Error: ./HardonCollider/polygon.lua:329: attempt to call method 'isConvex' (a nil value)
stack traceback:
./HardonCollider/polygon.lua:329: in function 'splitConvex'
./HardonCollider/shapes.lua:115: in function 'construct'
./HardonCollider/class.lua:93: in function <./HardonCollider/class.lua:90>
(tail call): ?
(tail call): ?
[string "HardonCollider/init.lua"]:129: in function <[string "HardonCollider/init.lua"]:128>
(tail call): ?
[string "main.lua"]:22: in function 'load'
[string "boot.lua"]:310: in function <[string "boot.lua"]:308>
[C]: in function 'xpcall'