Comment puis-je refléter l'appareil d'un corps dans un axe (x ou y), parce que quand je veux le refléter seulement dans un, une erreur d'assertion se produit, mais quand je miroir dans les deux axes, aucun problème ne se produit.Corps de miroir construit avec des vertex dans box2d et libgdx
public Vector2[][] getPolygons(String bodyName, float scaleX, float scaleY)
{
Vector2[][] vectors = null;
Element fixture;
Element semiPolygon;
float auxX, auxY;
this.element = reader.parse(xml);
fixture = this.element.getChildByName(bodyName);
vectors = new Vector2[fixture.getChildCount()][];
for(int child = 0; child < fixture.getChildCount(); child++)
{
semiPolygon = fixture.getChild(child);
vectors[child] = new Vector2[semiPolygon.getChildCount()];
for(int part = 0; part < semiPolygon.getChildCount(); part++)
{
auxX = semiPolygon.getChild(part).getFloatAttribute("x")*-scaleX;
auxY = semiPolygon.getChild(part).getFloatAttribute("y")*-scaleY;
vectors[child][part] = World.toGameCoordinates(auxX, auxY);
}
}
return vectors;
}
alors ... où l'affirmation se produit-elle? – iforce2d