Hi Philipp,
Physics bodies are always center-oriented, and the “reference point” applies to the image aspect only.
One workaround would be to use a little routine that gets the “new center point” of a rotated image using “localToContent()”, then repositioning the object based on this point (and the rotation you desire):
[lua]
local rectOrig = display.newRect(200,400,80,200) ; rectOrig.alpha = 0.5
local rect = display.newRect(200,400,80,200)
physics.addBody( rect, “static” )
–rotate the rect based on the top-left reference point
rect:setReferencePoint(display.TopLeftReferencePoint)
rect.rotation = -30
–get the “content center point” after rotation
local rectContentX, rectContentY = rect:localToContent( 0,0 )
–temporarily restore object to 0 rotation and center reference point
rect.rotation = 0
rect:setReferencePoint(display.CenterReferencePoint)
–move it to the values determined above
rect.x, rect.y = rectContentX, rectContentY
–rotate it back to the angle you want
rect.rotation = -30
–object and physics body are now synched around center reference point!
[/lua]
Hope this helps,
Brent