[Solved]How to calculate the center point of a Body.

KATO2

31-08-2011 23:41:23

Hey friends i need calculate the center point of a body which has been rotated, i tried to use getPosition(), but this function give me the base point of the body and how the body has been rotated this point can be in a different place that bottom base.

i tried add size()/2 to the position of body, but the body has been rotated, and i don't know how to calculate size of the body according to current orientation.

i will appreciate your help.

PD: sorry by my bad english.

SFCBias

01-09-2011 00:17:50

First thing that comes to mind is Body::getCenterOfMass

KATO2

01-09-2011 00:20:19

hello, i solved the problem by myself using AxisAlignedBox. Thanks anyway .