vanderlin / ofxBox2d

Openframework wrapper for box2d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set position of box2dshape

gongzai1219 opened this issue · comments

I'm confused about ofxBox2dBaseShape::setPosition(float x, float y).
Is this method going to set polygon's center to desired point?
Here is my code that how I used this method:

ofVec2f personOrigin = persons[nPressedPersonIndex]->getOrigin();

triangles[nPressedPersonIndex].get()->setPosition(personOrigin);
ofVec2f point = triangles[nPressedPersonIndex]->getPosition();

However, the value of "point" is different from the value of "personOrigin".
That is, like, I want to set the position of a polygon to (567, 56), but it goes to (1654, 589).

If this method is not used to set polygon's center to desired position, how can I change my polygon's position?

This was a bug - but has been resolved.