kripken / box2d.js

Port of Box2D to JavaScript using Emscripten
1.32k stars 198 forks source link

body and fixture GetNext() does not return null on end of list. #48

Open shakiba opened 10 years ago

shakiba commented 10 years ago

When trying to iterate over world bodies or body fixtures GetNext() should return null, but it seems box2d.js returns a special object instead. How can I use it to find out if it is end of iteration?

hellochar commented 9 years ago

As a workaround, you can test the body's a variable, which is 0 at the end of a list

theaidem commented 9 years ago

Also, You can check .IsActive() method for every next body