rotation on line display object collision

I create a square using display.newLine, then add the other 3 sides using append.
Then I use addBody to add a body for collision detection
Using hybrid draw mode I can see the collision boundaries match the square correctly.

Everything is fine at this point - collision detection works great.

The problem arises when I set the square to rotate. Although, according to the hybrid drawmode, the collision boundaries stay exactly with the drawn square. In real life, collisions start happening elsewhere on the screen.

I’ve tried different physics bodies, changing xReference etc, but the real collision boundaries do not match what is drawn on screen and shown in hybrid mode.

Is this a problem with the hybrid mode?
[import]uid: 49842 topic_id: 11419 reply_id: 311419[/import]

ok, problem narrowed down to x & y Reference of display object
I need the objects to rotate around their center. When I change the reference, although the object rotates fine, and the hybrid lines also match correctly, in actual fact, the physics detection is ignoring the x & y reference change and does not match what hybrid is drawing.

[import]uid: 49842 topic_id: 11419 reply_id: 41374[/import]

Is there a specific reason why you are drawing a square using lines instead of just drawing an actual square with display.newRect? [import]uid: 27965 topic_id: 11419 reply_id: 41376[/import]

square is just an example to keep it simple.

the program is actually creating a variety of different shapes

Update: the only way I can get this to rotate (with its physics detection intact) is to make the first point of the displayline, the center point of the whole object, then set xy reference to this point. The problem is I do not want a line going from the center of each object. There is no way to delete it later. Maybe I can mask it or something, but this is a bit of a hash. [import]uid: 49842 topic_id: 11419 reply_id: 41377[/import]