libgdx - Objects pass through each other -


i've 2 objects, 1 static , 1 dynamic. fixtures of both of them created chainshape. problem pass through each other.

screenshot :

enter image description here

two chainshapes dont collide each other make 1 of them polygonshape. works me:

bodydef triangledef = new bodydef(); triangledef.type = bodydef.bodytype.dynamicbody; triangledef.position.set( 0, 0 ); body trianglebody = this.world.createbody( triangledef ); polygonshape triangleshape = new polygonshape(); triangleshape.set( new float[]{ 0, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f } ); trianglebody.createfixture( triangleshape, 1 ); triangleshape.dispose();  bodydef grounddef = new bodydef(); triangledef.position.set( 0, 0 ); body groundbody = this.world.createbody( grounddef ); chainshape groundshape = new chainshape(); groundshape.createloop( new float[]{ -10, 10, -10, -10, 10, -10, 10, 10 } ); groundbody.createfixture( groundshape, 1 ); groundshape.dispose(); 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -