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())總是空...