position & rotation of shapes

Hey Erin,
Just thought this might be useful if you're using image sprites which don't
care about vertices.
Having the rotation angle and the positions of shapes for drawing all the shapes
of a particular body.

edit:
I'm trying to use sprite images instead of polygons for the shapes. So for the positions of polygons do I average all the vertices after the multiplication by the rotation matrix?
Or is the center of the polygon stored somewhere?
Thanks,
Mike
I do some pre-processing of the shape data. In particular I resolve polygon local translation and rotation so that the vertices are computed in the body's frame.

What you should do is store your local shape transforms and bind it to the shape's user data. Then you can compose the shape's local transform with the parent body's transform to get the shape's world transform.

Does this work for you?
Ah sounds good. I would imagine using the lib to control sprites would be
a common usage so it might be a nice to build that ability in.
Hmm it almost sounds like finding the center of the polygon by averaging the
vertices and using the body rotation would be cheaper in terms of speed (no multiply).
I'll try it and see if that works.
Mike

edit:
Oh never mind.. It's more complicated than that..need to account
for local rotation.

Sorry to be a pain..I'm just confused..
What is the m_position of a polygon? Is that the world position of the center?

Original thread: https://box2d.org/forum/viewtopic.php?t=99