Custom collision shape question.

Hi,

I have a big square but I’m interested on having a smaller square inside it as physics and I think solution is to define a shape by points. If I understood clearly, points that you define for a physic object is calculated with the center of the object in mind. So 0,0 will be center of the object.

Is there any way to change this behavior, like we can with setReferencePoint?

I tried calling setReferencePoint(display.CenterReferencePoint); and then assign points to do so but it seems those points do not check what reference point is and always use actual center of the object.

Hope I was clear with my question. [import]uid: 206803 topic_id: 34425 reply_id: 334425[/import]

I don’t believe you can change the reference point for the purpose of the physics calculations. 0,0 will be the center.
[import]uid: 199310 topic_id: 34425 reply_id: 136789[/import]

Thanks man. Let me clarify this, for the physics, (0,0) is always the center of the smallest bounding box that covers the image, right? [import]uid: 206803 topic_id: 34425 reply_id: 136800[/import]

Yes. image.width / 2, image.height / 2 would be another way to think of it. Of course your physics shape can be smaller than the image or larger if you want.

[import]uid: 199310 topic_id: 34425 reply_id: 136834[/import]

I don’t believe you can change the reference point for the purpose of the physics calculations. 0,0 will be the center.
[import]uid: 199310 topic_id: 34425 reply_id: 136789[/import]

Thanks man. Let me clarify this, for the physics, (0,0) is always the center of the smallest bounding box that covers the image, right? [import]uid: 206803 topic_id: 34425 reply_id: 136800[/import]

Yes. image.width / 2, image.height / 2 would be another way to think of it. Of course your physics shape can be smaller than the image or larger if you want.

[import]uid: 199310 topic_id: 34425 reply_id: 136834[/import]