setting a reference point, breaks the physics even though the hybrid view suggests it is correct… here is a self contained example based on the original post here:
http://developer.anscamobile.com/forum/2011/03/06/physics-issue-reference-points
[lua]local physics = require(“physics”)
local rnd=math.random
physics.start()
physics.setDrawMode(“hybrid”)
physics.setGravity(0,0)
line = display.newRect(0,0,6,250)
line:setFillColor(255,0,0,255)
– **** this line breaks it ****
line:setReferencePoint(display.BottomCenterReferencePoint)
line.x = display.contentWidth/2
line.y = display.contentHeight/2
line.rotation = 0
physics.addBody(line, “kinematic”)
line.isBullet=true
line.angularVelocity=100
function spawnBall()
local radius = rnd(5,30)
local ball = display.newCircle(0,0,radius)
ball:setFillColor(0,255,0,255)
ball.x = rnd(100,350)
ball.y = rnd(300,400)
physics.addBody(ball,“dynamic”, {radius=radius})
ball.isBullet=true
end
timer.performWithDelay(10, spawnBall,100)[/lua] [import]uid: 6645 topic_id: 7518 reply_id: 307518[/import]