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(); }
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); }
@Override protected ParticleEffect newObject() { ParticleEffect newEffect = sourceEffect.copy(); newEffect.init(); ParticleSystem.get().add(newEffect); return newEffect; }
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(); }
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); }
public ParticleRenderingSystem(Entities entities) { super(Aspect.all(NodeComponent.class, ParticleEffectComponent.class), entities); particleSystem = new ParticleSystem(); particleEffectProvider = new ParticleEffectProvider(); }
public ParticleSystem getParticleSystem() { return particleSystem; }
public ParticleUtils() { particleSystem = ParticleSystem.get(); }
public ParticleSystem updateAndDraw() { update(); return particleSystem; }
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); }