Physics joint issue

Hi guys,

I have a rectangle that is joint to the celling. which works, but I want to join the rectangle at the tip to the celling. At the moment the rectangle seems to be hooked at the center.
I thought I could change the setReferencePoint, but nothing happens..

any help is appreciated

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local physics = require "physics"
physics.start( true )
physics.setDrawMode("normal")   -- set to "debug" or "hybrid" to see collision boundaries
physics.setDrawMode("hybrid")
physics.setGravity( 0, 9.8 )    --> 0, 9.8 = Earth-like gravity
        
        
local lineShape = { -5,-5, 5,-5, 5,5, -5,5 }
        
local cel = display.newRect(0, 0, display.contentWidth, 100)
physics.addBody(cel, "static"  )        
 
 
 
local line = display.newRect(100, 200, 10, 200)
line:setReferencePoint( display.TopLeftReferencePoint )
 
physics.addBody(line, "dynamic"  )
 
 
local joint = physics.newJoint( "pivot", cel, line, cel.x, cel.y )      
views:1463 update:2011/12/28 9:26:54
corona forums © 2003-2011