protected JPanel getPanel (ParticleBatch renderer) { if(renderer instanceof PointSpriteParticleBatch){ return new EmptyPanel(this, "Point Sprite Batch", "It renders particles as point sprites."); } if(renderer instanceof BillboardParticleBatch){ return new BillboardBatchPanel(this, (BillboardParticleBatch) renderer); } else if(renderer instanceof ModelInstanceParticleBatch){ return new EmptyPanel(this, "Model Instance Batch", "It renders particles as model instances."); } return null; }
@Override public void create () { super.create(); emitters = new Array<ParticleController>(); assets.load(DEFAULT_PARTICLE, Texture.class); assets.load(DEFAULT_SKIN, Skin.class); loading = true; environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0f, 0f, 0.1f, 1f)); environment.add(new DirectionalLight().set(1f, 1f, 1f, 0, -0.5f, -1 )); billboardParticleBatch = new BillboardParticleBatch(); billboardParticleBatch.setCamera(cam); ui = new Stage(); builder = new StringBuilder(); }
public void initBillBoardParticles(Camera camera) { BillboardParticleBatch billboardParticleBatch = new BillboardParticleBatch(); billboardParticleBatch.setCamera(camera); particleSystem.add(billboardParticleBatch); initManager(); }
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); }
public BillboardRenderer(BillboardParticleBatch batch){ this(); setBatch(batch); }
@Override public boolean isCompatible (ParticleBatch<?> batch) { return batch instanceof BillboardParticleBatch; }
public BillboardParticleBatch getBillboardBatch () { return renderer.billboardBatch; }
public BillboardBatchPanel (FlameMain particleEditor3D, BillboardParticleBatch renderer) { super(particleEditor3D, "Billboard Batch", "Renderer used to draw billboards particles."); initializeComponents(renderer); setValue(renderer); }