小编use*_*976的帖子

碰撞后如何使两个身体粘住?

我真的坚持这个我可以成功地发现碰撞,但我不能让两个身体参与碰撞.

这是我的ContactListener

world.setContactListener(listener);

    listener = new ContactListener() {

        @Override
        public void preSolve(Contact contact, Manifold oldManifold) {

        }


        @Override
        public void postSolve(Contact contact, ContactImpulse impulse) {

        }

        //called when two fixtures cease to touch
        @Override
        public void endContact(Contact contact) {
            Fixture fixtureA = contact.getFixtureA();
            Fixture fixtureB = contact.getFixtureB();
            Gdx.app.log("beginContact", "between" + fixtureA.toString() + "and" + fixtureB.toString());
        }

        //called when two fixtures begin to touch
        @Override
        public void beginContact(Contact contact) {
            Fixture fixtureA = contact.getFixtureA();
            Fixture fixtureB = contact.getFixtureB();
            Gdx.app.log("beginContact", "between" …
Run Code Online (Sandbox Code Playgroud)

java box2d jbox2d libgdx

4
推荐指数
1
解决办法
1021
查看次数

如何在白色背景上显示Libgdx粒子效果?

目前在我render()的背景颜色设置为白色,但当我将其更改为白色时,根本无法看到我的效果.

我想知道是否有我需要启用的选项或我可能错过的一行代码?

public void render(float delta) {
    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    batch.begin();
    effect.update(delta);
    effect.draw(batch);

    batch.end();

}
Run Code Online (Sandbox Code Playgroud)

//这是.p文件

Untitled
- Delay -
active: false
- Duration - 
lowMin: 3000.0
lowMax: 3000.0
- Count - 
min: 0
max: 200
- Emission - 
lowMin: 0.0
lowMax: 0.0
highMin: 250.0
highMax: 250.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life - 
lowMin: 0.0
lowMax: 0.0
highMin: 500.0
highMax: 1000.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 1.0 …
Run Code Online (Sandbox Code Playgroud)

java rendering particle-system libgdx

3
推荐指数
1
解决办法
1493
查看次数

标签 统计

java ×2

libgdx ×2

box2d ×1

jbox2d ×1

particle-system ×1

rendering ×1