()
| 150 | } |
| 151 | |
| 152 | func (world *B2World) Destroy() { |
| 153 | |
| 154 | // Some shapes allocate using b2Alloc. |
| 155 | b := world.M_bodyList |
| 156 | for b != nil { |
| 157 | bNext := b.M_next |
| 158 | |
| 159 | f := b.M_fixtureList |
| 160 | for f != nil { |
| 161 | fNext := f.M_next |
| 162 | f.M_proxyCount = 0 |
| 163 | f.Destroy() |
| 164 | f = fNext |
| 165 | } |
| 166 | |
| 167 | b = bNext |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func (world *B2World) SetDestructionListener(listener B2DestructionListenerInterface) { |
| 172 | world.M_destructionListener = listener |