Java 类com.badlogic.gdx.graphics.g3d.particles.ParticleSystem 实例源码

项目:GdxDemo3D    文件:GameScene.java   
public void dispose() {
    ParticleSystem particleSystem = ParticleSystem.get();
    for (ParticleEffect pfx : particleEffects) {
        particleSystem.remove(pfx);
        pfx.dispose();
    }
    particleEffects.clear();
    navMesh.dispose();
    for (Array<GameObject> objs : gameObjects.values()) {
        for (GameObject obj : objs) {
            obj.dispose();
        }
    }
    gameObjects.clear();
    assets.dispose();
}
项目:libgdxcn    文件:FlameMain.java   
public FlameMain () {
    super("Flame");
    MathUtils.random = new RandomXS128();
    particleSystem = ParticleSystem.get();
    effect = new ParticleEffect();
    particleSystem.add(effect);
    assetManager = new AssetManager();
    assetManager.setErrorListener(this);
    assetManager.setLoader(ParticleEffect.class, new ParticleEffectLoader(new InternalFileHandleResolver()));
    controllersData = new Array<ControllerData>();

    lwjglCanvas = new LwjglCanvas(renderer = new AppRenderer());
    addWindowListener(new WindowAdapter() {
        public void windowClosed (WindowEvent event) {
            //System.exit(0);
            Gdx.app.exit();
        }
    });

    initializeComponents();

    setSize(1280, 950);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setVisible(true);
}
项目:exterminate    文件:Assets.java   
@Override
protected ParticleEffect newObject() {
    ParticleEffect newEffect = sourceEffect.copy();
    newEffect.init();
    ParticleSystem.get().add(newEffect);
    return newEffect;
}
项目:gdx-proto    文件:Assets.java   
public static void loadParticleEffects(ParticleSystem particleSystem) {
    ParticleEffectLoader.ParticleEffectLoadParameter loadParam = new ParticleEffectLoader.ParticleEffectLoadParameter(particleSystem.getBatches());
    ParticleEffectLoader loader = new ParticleEffectLoader(new InternalFileHandleResolver());
    manager.setLoader(ParticleEffect.class, loader);
    manager.load("particle/bullet-hit.pfx", ParticleEffect.class, loadParam);
    manager.load("particle/blue-explosion.pfx", ParticleEffect.class, loadParam);
    manager.finishLoading();
}
项目:gdx-proto    文件:Particles.java   
public Particles() {
    inst = this;
    system = ParticleSystem.get();
    PointSpriteParticleBatch psBatch = new PointSpriteParticleBatch();
    psBatch.setCamera(View.inst.getCamera());
    system.add(psBatch);

    Assets.loadParticleEffects(system);

    ParticleEffect bulletHit = Assets.manager.get("particle/bullet-hit.pfx");
    ParticleEffect blueExplosion = Assets.manager.get("particle/blue-explosion.pfx");
    bulletHitPool = new PFXPool(bulletHit);
    blueExplosionPool = new PFXPool(blueExplosion);
}
项目:nhglib    文件:ParticleRenderingSystem.java   
public ParticleRenderingSystem(Entities entities) {
    super(Aspect.all(NodeComponent.class, ParticleEffectComponent.class), entities);
    particleSystem = new ParticleSystem();
    particleEffectProvider = new ParticleEffectProvider();
}
项目:nhglib    文件:ParticleRenderingSystem.java   
public ParticleSystem getParticleSystem() {
    return particleSystem;
}
项目:Skyland    文件:ParticleUtils.java   
public ParticleUtils() {
    particleSystem = ParticleSystem.get();
}
项目:Skyland    文件:ParticleUtils.java   
public ParticleSystem updateAndDraw() {
    update();
    return particleSystem;
}
项目:Alien-Ark    文件:PlanetScreen.java   
private void initParticles() {
    // particles
    particleSystem = ParticleSystem.get();
    particleSpriteBatch = new BillboardParticleBatch();

    particleSpriteBatch.setCamera(camera);
    particleSystem.add(particleSpriteBatch);

    assetManager = new AssetManager();
    ParticleEffectLoader.ParticleEffectLoadParameter loadParam = new ParticleEffectLoader.ParticleEffectLoadParameter(particleSystem.getBatches());
    ParticleEffectLoader loader = new ParticleEffectLoader(new InternalFileHandleResolver());
    assetManager.setLoader(ParticleEffect.class, loader);
    assetManager.load("particles/3D/rocket_thruster.pfx", ParticleEffect.class, loadParam);
    assetManager.load("particles/3D/rocket_explosion.pfx", ParticleEffect.class, loadParam);
    assetManager.load("particles/3D/planet_portal.pfx", ParticleEffect.class, loadParam);
    assetManager.finishLoading();

    effectThrust = new ParticleEffect[3];
    effectThrust[0] =       ((ParticleEffect) assetManager.get("particles/3D/rocket_thruster.pfx")).copy();
    effectThrust[1] =       ((ParticleEffect) assetManager.get("particles/3D/rocket_thruster.pfx")).copy();
    effectThrust[2] =       ((ParticleEffect) assetManager.get("particles/3D/rocket_thruster.pfx")).copy();

    effectExplosion =   ((ParticleEffect) assetManager.get("particles/3D/rocket_explosion.pfx")).copy();
    effectPortal =      ((ParticleEffect) assetManager.get("particles/3D/planet_portal.pfx")).copy();
    effectExplosion.init();

    for (ParticleEffect e : effectThrust) {
        e.init();
        e.start();


        particleSystem.add(e);

    }

    effectPortal.init();
    effectPortal.start();
    effectPortal.translate(new Vector3(-30, 0, 135));
    effectPortal.rotate(Vector3.Z, 90);
    effectPortal.rotate(Vector3.X, 30);
    effectPortal.scale(2f, 2f, 2f);


    particleSystem.add(effectPortal);
}