I’ve just started have issues when trying to add display groups to the physics engine. My code looks like this:
[lua]
local hw=obj.contentWidth/2
local hh=obj.contentHeight/2
local shape={
-hw,-hh,
hw,-hh,
hw,hh,
-hw,hh
}
physics.addBody(obj,“dynamic”,{density=60.0, friction=0.8, bounce=0.1, shape=shape, filter=collisionFilter})
[/lua]
If obj is a image object the bounding box works fine - (I define it manually as obj will have x and y scales between 0.7 and 1). If the object is a displayGroup containing a rectangular image, the bounding box appears around the top left corner of the group.
Is there anyway around this? I’ve tried setting the reference point. What I want to achieve is to have physics objects made up lots of smaller images, but which behave as a single rigid body with a bounding box that I define.
Thanks,