and apologies in advance for this fairly random question.
I'm using Love2D 0.9.1 and Box2D to create two bodies joined by a revolute joint. A simplified representation of the two bodies is a Sphere and a rectangle:
hero.heroPhysics = {}
hero.heroPhysics.body = love.physics.newBody(theWorld, hero.x,hero.y,"dynamic")
hero.heroPhysics.shape = love.physics.newCircleShape(CONSTANT_heroRadius)
hero.extraPhysics = {}
hero.extraPhysics.body = love.physics.newBody(theWorld, hero.x,hero.y,"dynamic")
hero.extraPhysics.shape = love.physics.newRectangleShape(CONSTANT_heroRadius * 3, 8)
hero.jointPhysics = {}
local hx,hy = hero.heroPhysics.body:getWorldCenter()
hero.jointPhysics.joint = love.physics.newRevoluteJoint(hero.heroPhysics.body, hero.extraPhysics.body, hx, hy, false)
Everything seems to be ok, except that the anchor points of the joint are the centers of mass of the two bodies, and I'd like to manually adjust the anchor point of the rectangle to be closer to one end of the rectangle. However, I can't find a way in Love2D to set the joint anchor points? I can get the anchor points via Joint:getAnchors(), but not set them? Or maybe I'm missing something.
In pictures, I'm only able to get something resembling the bottom picture, whereas I really want something like the top picture (please excuse crude drawing):
I've tried changing the rectangle body's center of mass using body:setMassData(), but that doesn't seem to make a difference (unless I try to offset it too much, at which point Box2D dies).