private static Body createAppleBody(final PhysicsWorld pPhysicsWorld,final IAreaShape mSprite,final BodyType pBodyType,final FixtureDef pFixtureDef, final float pFruitX){
final BodyDef mBodyDef = new BodyDef();
mBodyDef.type = pBodyType;
mBodyDef.position.x = 1;
mBodyDef.position.y = 1;
final Body mBody = pPhysicsWorld.createBody(mBodyDef);
final float width = mSprite.getWidthScaled() / PIXEL_TO_METER_RATIO_DEFAULT;
final float height = mSprite.getHeightScaled() / PIXEL_TO_METER_RATIO_DEFAULT;
// =============================================
// poly 1
final PolygonShape mPoly = new PolygonShape();
final Vector2[] pVertices = {
//autogenerated code
new Vector2(-0.10146f*width, +0.13910f*height),
new Vector2(+0.05500f*width, +0.37631f*height),
new Vector2(-0.06108f*width, +0.42173f*height),
new Vector2(-0.17717f*width, +0.38135f*height)
};
mPoly.set(pVertices);
pFixtureDef.shape = mPoly;
mBody.createFixture(pFixtureDef);
mPoly.dispose();
// =============================================
// =============================================
// poly 2
final PolygonShape mPoly2 = new PolygonShape();
final Vector2[] pVertices2 = {
//autogenerated code
new Vector2(-0.33867f*width, -0.31514f*height),
new Vector2(-0.08632f*width, -0.40094f*height),
new Vector2(+0.28211f*width, +0.17443f*height),
new Vector2(-0.12165f*width, +0.15928f*height),
new Vector2(-0.34877f*width, +0.13910f*height),
new Vector2(-0.46485f*width, -0.05774f*height)
};
mPoly2.set(pVertices2);
pFixtureDef.shape = mPoly2;
mBody.createFixture(pFixtureDef);
mPoly2.dispose();
// =============================================
// =============================================
// poly 2
final PolygonShape mPoly3 = new PolygonShape();
final Vector2[] pVertices3 = {
//autogenerated code
new Vector2(-0.09137f*width, -0.41103f*height),
new Vector2(+0.21146f*width, -0.40094f*height),
new Vector2(+0.43353f*width, -0.13849f*height),
new Vector2(+0.42848f*width, +0.07348f*height),
new Vector2(+0.25688f*width, +0.17443f*height)
};
mPoly3.set(pVertices3);
pFixtureDef.shape = mPoly3;
mBody.createFixture(pFixtureDef);
mPoly3.dispose();
// =============================================
return mBody;
}