1
Body b;
while ((b=box2d.physics.PhysicssWorld.world.getBodyList().getNext())!=null) {
Shape shape;
while ((shape=b.getShapeList().getNext())!=null) {
Log.e("name",""+b.getUserData().toString()+" "+shape+" ");
opengl.saveMatrix();
Meshes.select(b.getUserData().toString())
.translate((b.getPosition().x)*RATIO, (b.getPosition().y)*RATIO)
.rotate((int) ((int) b.getAngle()* (180/Math.PI)), 0, 0, 1)
.draw(shape, 1,1,1);
opengl.loadMatrix();
}
}
我喜欢让我的身体的形状,但我无法得到任何东西,只有空..为什么?不要运行这一行:Log.e(“name”,“”+ b.getUserData()。toString()+“”+ shape +“”);Box2D得到我的身体的形状
所以形状= b.getShapeList()。GETNEXT())总是空...