pingjiang / rokon

Automatically exported from code.google.com/p/rokon
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Objects created by PhysicalSprite.createStaticBody(Shape) does not perform collison check. #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Object created by PhysicalSprite.createStaticBody() as below
PhysicalSprite obj = new PhysicalSprite(0, 0, Textures.obj2.getWidth(), 
Textures.obj2.getHeight());
                PolygonShape ps = new PolygonShape();
                Vector2[] vct = new Vector2[4];       
                vct[0]= new Vector2(0,  0);
                vct[1]= new Vector2(0,Textures.obj2.getHeight());
                vct[2]= new Vector2(Textures.obj2.getWidth(),Textures.obj2.getHeight());
                vct[3]= new Vector2(Textures.obj2.getWidth(), 0);
                ps.set(vct);
                obj.createStaticBody(ps);
                obj.setTexture(Textures.obj2);
                obj.setBorder(1, 0, 0, 1f);
                add(0, obj);
2.
3.

What is the expected output?
The object is supposed to perform collison check just like a normal 
PhysicalSprite.

What do you see instead?
It is penetrated.

What version of Rokon are you using?
2.0.3

On which version of Android are you experiencing this?
2.1

Please provide any additional information below.
I changed the source of createWalls() function in Donate_App as above. 
createStaticBox() could work fine. But when I tried to created a polygon it 
failed.

Original issue reported on code.google.com by maheyma...@gmail.com on 19 Aug 2010 at 1:14

GoogleCodeExporter commented 9 years ago
This isn't true.

Your polygon must be clockwise.

Original comment by rtaylor205@gmail.com on 5 Sep 2010 at 8:12