2

I am trying to create a distructable floor in chipmunk

Pretty much I need a floor or body object that when a bomb explodes that the floor disappears in the area of the balls defined explosion area.

I considered useing a CPpoly shape to do this and define the vertexes each time that a bomb exploded, but discovered that this was not only intractable, but practically impossible.

Does anybody have any ideas on how I could do this in chipmunk? and sorry I am relatively new to the language and know literally only the basics. Thank you for your help.

Francis McGrew
  • 7,264
  • 1
  • 33
  • 30
Thermo
  • 55
  • 1
  • 5

1 Answers1

2

Deformable terrain with a physics engine isn't easy. I've been making an add-on library for Chipmunk that can help do it though. http://www.cocos2d-iphone.org/forum/topic/20792

Basically you are going to have to reconstruct the geometry every time something changes. Your choices include marching squares or CSG. Neither are particularly easy to make run in real time though.

slembcke
  • 1,359
  • 7
  • 7