I’m having trouble creating a complex body that includes a circle that is not centered at the origin. This may be a super simple question or not possible at all using the current implementation of Box2d in Corona. Here’s what I’ve got:
-- Create the Avatar Physics Body
squareShape = { -15,-40, 15,-40, 15,45, -15,45 }
sensorShape = { -8,40, 8,40, 8,50, -8,50 }
physics.addBody(self.avatar,
{density = .5, friction = 0, bounce = 0, shape = squareShape, filter = self.avatar\_collision\_filter },
{density = .5, friction = 0, bounce = 0, shape = sensorShape, isSensor = true, filter = self.avatar\_collision\_filter}
)
I want to make my sensor a circle instead of a rectangle. I know I can specify a shape as a circle by adding a radius like this:
{density = .5, friction = 0, bounce = 0, radius = 10, isSensor = true, filter = self.avatar\_collision\_filter}
But I can’t figure out how to move the circle from the origin. Is this possible?
Thanks. [import]uid: 136876 topic_id: 26925 reply_id: 326925[/import]