It's my first question here. I've looked for some topic similar to this but I haven't found anything. What I want to do is making a fixture for a polygon. First of all I've created a map with Tiled. Then I take the points in the polyline field of the object. But when I run the program, the polygon fixture is in another place. I print the points in the console and they are correct, but they are moved in the map.
I also make rectangles shapes, more less, in the same way and it works perfectly.
I have a function like this to extract the points (because the field polyline doesn't return the points as love.physics.newFixture expects):
Code: Select all
function makePointsPolyline(polyline)
local points = {}
for i,obj in pairs(polyline) do
table.insert(points, obj.x)
table.insert(points, obj.y)
end
return points
end
Code: Select all
platform.body = love.physics.newBody(myWorld, x, y, "static")
platform.shape = love.physics.newPolygonShape(points)
platform.fixture = love.physics.newFixture(platform.body, platform.shape)