Need help deciding

Topics: Developer Forum, User Forum
May 23, 2008 at 7:48 PM
I am stuck trying to figure out a good way to implement body/geometry with my 2D animated actors. Each actor is animated and each animated frame may have a different shape, so i'm trying to figure out a way to have the geometry match the actors current animated frame. Without having to create a geometry object for each frame of animation.

My current thoughts are to just to hold a vertexlist for each frame of animation and then use geometry.setvertexes to update the vertexes on the actors geometry as the animation plays but I think it wil not work because I will need to make sure that the collision grid is updated every time I set new vertexes. And with potentially hundreds of animations on screen rebuilding a collision grid does not seem like a good idea performance wise ...

I was thinking I could create a geometry object for each frame but am unsure how that would work with only one body object.

And again there is the problem of adding and removing geometry from the simulator etc ...

Does anyone have any pointers they can give me regarding how to implement a farseer body/geometry that works well with animated items that have a different shape for each frame of animation?
May 24, 2008 at 11:12 PM
You could have all the geoms on the body, then change their collision groups every frame of the animation so only the active body collides with the surroundings.