Box2d および Box2d Lights を使用した libgdx ゲームを開発中です。
私の質問は、Bodys / Bodydefs が Box2d Light からの光源を無視し、影を落とさないようにするにはどうすればよいですか?
ありがとう。
PolygonShape groundBox = new PolygonShape();
groundBox.setAsBox(2f, 2f);
FixtureDef gridBox = new FixtureDef();
gridBox.shape = groundBox;
gridBox.density = 1.0f;
gridBox.filter.groupIndex = GRID_GROUP;
gridBox.filter.categoryBits = GRID_CAT;
gridBox.filter.maskBits = GRID_MASK;
bodyDefs[i][j] = new BodyDef();
bodyDefs[i][j].position.set(j*factor + factor, i*factor + factor);
bodyDefs[i][j].fixedRotation = true;
bodyDefs[i][j].type = BodyDef.BodyType.DynamicBody;
bodies[i][j] = world.createBody(bodyDefs[i][j]);
bodies[i][j].createFixture(gridBox);
handler = new RayHandler(world);
handler.setCombinedMatrix(camera.combined);
Filter filter = new Filter();
filter.groupIndex = GRID_GROUP; // GRID_GROUP = 1
filter.categoryBits = GRID_CAT; // GRID_CAT = 0x0001;
filter.maskBits = GRID_MASK; // GRID_MASK = 1;
new PointLight(handler, 1000, Color.RED, 2000, 0, height);
PointLight.setContactFilter(filter);