// Path: src/tonegod/gui/controls/extras/emitter/ElementEmitter.java
// public class ElementParticle {
// 	public QuadData particle;
// 	public Vector2f initialPosition = new Vector2f();
// 	public Vector2f position = new Vector2f();
// 	public Vector2f velocity = new Vector2f();
// 	public float randforce;
// 	public ColorRGBA color = new ColorRGBA();
// 	public float size = 1;
// 	public float life;
// 	public float startlife;
// 	public float angle;
// 	public float rotateSpeed;
// 	public boolean rotateDir;
// 	public boolean active = false;
// 	public float blend;
// 	private Map<String,Object> data = new HashMap();
// 	private float diffX, diffY;
// 		
// 	public void update(float tpf) {
// 		life -= tpf;
// 		blend = (startlife - life) / startlife;
// 		if (interpolation != null) blend = interpolation.apply(blend);
// 		if (life <= 0) {
// 			killParticle();
// 			return;
// 		}
// 			
// 		for (Influencer inf : influencers.values()) {
// 			if (inf.getIsEnabled())
// 				inf.update(this, tpf);
// 		}
// 			
// 		particle.setPosition(position);
// 		particle.setScaleX(size);
// 		particle.setScaleY(size);
// 		particle.getOrigin().set(spriteWidth*0.5f,spriteHeight*0.5f);
// 		particle.setColor(color);
// 		particle.setRotation(angle);
// 	};
// 		
// 	public void initialize(boolean hide) {
// 		diffX = FastMath.rand.nextFloat();
// 		diffY = FastMath.rand.nextFloat();
// 			
// 		if (emitterShape != null) {
// 			ir.getPixel((int)(diffX*(emitterShape.getImage().getWidth())),(int)(diffY*(emitterShape.getImage().getHeight())), tempColor);
// 			while (tempColor.r < 0.2f) {
// 				diffX = FastMath.rand.nextFloat();
// 				diffY = FastMath.rand.nextFloat();
// 				ir.getPixel((int)(diffX*(emitterShape.getImage().getWidth())),(int)(diffY*(emitterShape.getImage().getHeight())), tempColor);
// 			}
// 		}
// 			
// 		diffX *= emitterWidth;
// 		diffY *= emitterHeight;
// 			
// 		position.set(emitterPosition);
// 		position.subtractLocal(spriteWidth*0.5f,spriteHeight*0.5f);
// 		position.addLocal(diffX,diffY);
// 		initialPosition.set(position);
// 			
// 		if (!useFixedForce)
// 			randforce = (FastMath.nextRandomFloat()*(maxforce-minforce))+minforce;
// 		else
// 			randforce = maxforce;
// 			
// 		if (!centerVelocity) {
// 			float velX = FastMath.rand.nextFloat();
// 			if (FastMath.rand.nextBoolean()) velX = -velX;
// 			float velY = FastMath.rand.nextFloat();
// 			if (FastMath.rand.nextBoolean()) velY = -velY;
// 			velocity.set(velX,velY);
// 		} else {
// 			velocity.set(1/emitterWidth*diffX, 1/emitterHeight*diffY);
// 			velocity.subtractLocal(0.5f,0.5f);
// 		}
// 			
// 		if (useFixedDirection)
// 			velocity.interpolate(fixedDirection, fixedDirectionStrength);
// 			
// 		velocity.multLocal(randforce);
// 			
// 		if (useFixedLife)
// 			life = highLife;
// 		else {
// 			startlife = (highLife - lowLife) * FastMath.nextRandomFloat() + lowLife ;
// 			life = startlife;
// 		}
// 		rotateDir = FastMath.rand.nextBoolean();
// 		rotateSpeed = FastMath.rand.nextFloat();
// 		size = 1;
// 			
// 		for (Influencer inf : influencers.values()) {
// 			inf.initialize(this);
// 		}
// 			
// 		active = !hide;
// 		if (hide)	particle.hide();
// 		else		particle.show();
// 		update(0);
// 	}
// 		
// 	public void killParticle() {
// 		active = false;
// 		activeParticleCount--;
// 		particle.hide();
// 	}
// 		
// 	public void putData(String key, Object object) {
// 		data.put(key, object);
// 	}
// 		
// 	public Object getData(String key) {
// 		return data.get(key);
// 	}
// }


import com.jme3.math.Vector2f;
import tonegod.gui.controls.extras.emitter.ElementEmitter.ElementParticle;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tonegod.gui.controls.extras.emitter;


/**
 *
 * @author t0neg0d
 */
public class DirectionInfluencer extends InfluencerBase {
	
	private boolean isEnabled = true;
	private Vector2f direction = Vector2f.ZERO.clone();
	private Vector2f temp = new Vector2f();
	private float strength = 1;
	
	public DirectionInfluencer(ElementEmitter emitter) {
		super(emitter);
	}
	
	@Override

// Path: src/tonegod/gui/controls/extras/emitter/ElementEmitter.java
// public class ElementParticle {
// 	public QuadData particle;
// 	public Vector2f initialPosition = new Vector2f();
// 	public Vector2f position = new Vector2f();
// 	public Vector2f velocity = new Vector2f();
// 	public float randforce;
// 	public ColorRGBA color = new ColorRGBA();
// 	public float size = 1;
// 	public float life;
// 	public float startlife;
// 	public float angle;
// 	public float rotateSpeed;
// 	public boolean rotateDir;
// 	public boolean active = false;
// 	public float blend;
// 	private Map<String,Object> data = new HashMap();
// 	private float diffX, diffY;
// 		
// 	public void update(float tpf) {
// 		life -= tpf;
// 		blend = (startlife - life) / startlife;
// 		if (interpolation != null) blend = interpolation.apply(blend);
// 		if (life <= 0) {
// 			killParticle();
// 			return;
// 		}
// 			
// 		for (Influencer inf : influencers.values()) {
// 			if (inf.getIsEnabled())
// 				inf.update(this, tpf);
// 		}
// 			
// 		particle.setPosition(position);
// 		particle.setScaleX(size);
// 		particle.setScaleY(size);
// 		particle.getOrigin().set(spriteWidth*0.5f,spriteHeight*0.5f);
// 		particle.setColor(color);
// 		particle.setRotation(angle);
// 	};
// 		
// 	public void initialize(boolean hide) {
// 		diffX = FastMath.rand.nextFloat();
// 		diffY = FastMath.rand.nextFloat();
// 			
// 		if (emitterShape != null) {
// 			ir.getPixel((int)(diffX*(emitterShape.getImage().getWidth())),(int)(diffY*(emitterShape.getImage().getHeight())), tempColor);
// 			while (tempColor.r < 0.2f) {
// 				diffX = FastMath.rand.nextFloat();
// 				diffY = FastMath.rand.nextFloat();
// 				ir.getPixel((int)(diffX*(emitterShape.getImage().getWidth())),(int)(diffY*(emitterShape.getImage().getHeight())), tempColor);
// 			}
// 		}
// 			
// 		diffX *= emitterWidth;
// 		diffY *= emitterHeight;
// 			
// 		position.set(emitterPosition);
// 		position.subtractLocal(spriteWidth*0.5f,spriteHeight*0.5f);
// 		position.addLocal(diffX,diffY);
// 		initialPosition.set(position);
// 			
// 		if (!useFixedForce)
// 			randforce = (FastMath.nextRandomFloat()*(maxforce-minforce))+minforce;
// 		else
// 			randforce = maxforce;
// 			
// 		if (!centerVelocity) {
// 			float velX = FastMath.rand.nextFloat();
// 			if (FastMath.rand.nextBoolean()) velX = -velX;
// 			float velY = FastMath.rand.nextFloat();
// 			if (FastMath.rand.nextBoolean()) velY = -velY;
// 			velocity.set(velX,velY);
// 		} else {
// 			velocity.set(1/emitterWidth*diffX, 1/emitterHeight*diffY);
// 			velocity.subtractLocal(0.5f,0.5f);
// 		}
// 			
// 		if (useFixedDirection)
// 			velocity.interpolate(fixedDirection, fixedDirectionStrength);
// 			
// 		velocity.multLocal(randforce);
// 			
// 		if (useFixedLife)
// 			life = highLife;
// 		else {
// 			startlife = (highLife - lowLife) * FastMath.nextRandomFloat() + lowLife ;
// 			life = startlife;
// 		}
// 		rotateDir = FastMath.rand.nextBoolean();
// 		rotateSpeed = FastMath.rand.nextFloat();
// 		size = 1;
// 			
// 		for (Influencer inf : influencers.values()) {
// 			inf.initialize(this);
// 		}
// 			
// 		active = !hide;
// 		if (hide)	particle.hide();
// 		else		particle.show();
// 		update(0);
// 	}
// 		
// 	public void killParticle() {
// 		active = false;
// 		activeParticleCount--;
// 		particle.hide();
// 	}
// 		
// 	public void putData(String key, Object object) {
// 		data.put(key, object);
// 	}
// 		
// 	public Object getData(String key) {
// 		return data.get(key);
// 	}
// }


// Path: src/tonegod/gui/controls/extras/emitter/DirectionInfluencer.java
import com.jme3.math.Vector2f;
import tonegod.gui.controls.extras.emitter.ElementEmitter.ElementParticle;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tonegod.gui.controls.extras.emitter;


/**
 *
 * @author t0neg0d
 */
public class DirectionInfluencer extends InfluencerBase {
	
	private boolean isEnabled = true;
	private Vector2f direction = Vector2f.ZERO.clone();
	private Vector2f temp = new Vector2f();
	private float strength = 1;
	
	public DirectionInfluencer(ElementEmitter emitter) {
		super(emitter);
	}
	
	@Override

	public void update(ElementParticle p, float tpf) {
