a327ex / windfield

Physics module for LÖVE
453 stars 55 forks source link

Debug drawing doesn't represent location of secondary fixtures. #5

Closed Muzz closed 9 years ago

Muzz commented 9 years ago

Debug drawing doesn't represent location of secondary fixtures.

Repro.

self.collision = world:newRectangleCollider(x or 100, y or 100, 5, 70, {collision_class = 'Arrow'}) self.collision.body:setFixedRotation(false)

self.collision.fixtures['main']:setRestitution(0.6) self.collision.body:setLinearVelocity(1000_vec.x,1000_vec.y) self.collision.body:setAngle(math.deg(math.atan2(vec.y,vec.x))+90 or 90)

-- there is a bug here that doesn't draw the debug correctly for added shapes. self.collision:addShape("head", "CircleShape", 0,-70,10)

a327ex commented 9 years ago

Fixed. You should add the shape with y = -35 though, because it's always local in relation to the center of the body.