Home | History | Annotate | Download | only in particles
      1 package com.badlogic.gdx.graphics.g3d.particles;
      2 
      3 import com.badlogic.gdx.assets.AssetManager;
      4 import com.badlogic.gdx.math.Matrix3;
      5 import com.badlogic.gdx.math.Matrix4;
      6 import com.badlogic.gdx.math.Quaternion;
      7 import com.badlogic.gdx.math.Vector3;
      8 import com.badlogic.gdx.utils.Disposable;
      9 import com.badlogic.gdx.utils.Json;
     10 import com.badlogic.gdx.utils.JsonValue;
     11 
     12 
     13 /** It's the base class of every {@link ParticleController} component.
     14  * A component duty is to participate in one or some events during the simulation.
     15  * (i.e it can handle the particles emission or modify particle properties, etc.).
     16  * @author inferno */
     17 public abstract class ParticleControllerComponent implements Disposable, Json.Serializable, ResourceData.Configurable {
     18 	protected static final Vector3 TMP_V1 = new Vector3(),
     19 		 TMP_V2 = new Vector3(),
     20 		 TMP_V3 = new Vector3(),
     21 		 TMP_V4 = new Vector3(),
     22 		 TMP_V5 = new Vector3(),
     23 		 TMP_V6 = new Vector3();
     24 	protected static final Quaternion TMP_Q = new Quaternion(), TMP_Q2 = new Quaternion();
     25 	protected static final Matrix3 TMP_M3 = new Matrix3();
     26 	protected static final Matrix4 TMP_M4 = new Matrix4();
     27 	protected ParticleController controller;
     28 	/** Called to initialize new emitted particles. */
     29 	public void activateParticles (int startIndex, int count){};
     30 	/** Called to notify which particles have been killed. */
     31 	public void killParticles (int startIndex, int count){};
     32 	/** Called to execute the component behavior. */
     33 	public void update (){};
     34 	/** Called once during intialization */
     35 	public void init (){};
     36 	/** Called at the start of the simulation. */
     37 	public void start(){};
     38 	/** Called at the end of the simulation. */
     39 	public void end(){};
     40 	public void dispose(){}
     41 	public abstract ParticleControllerComponent copy();
     42 	/** Called during initialization to allocate additional particles channels*/
     43 	public void allocateChannels(){}
     44 	public void set(ParticleController particleController) {
     45 		controller = particleController;
     46 	}
     47 
     48 	@Override
     49 	public void save (AssetManager manager, ResourceData data) {}
     50 	@Override
     51 	public void load (AssetManager manager, ResourceData data) {}
     52 	@Override
     53 	public void write (Json json) {}
     54 	@Override
     55 	public void read (Json json, JsonValue jsonData) {}
     56 
     57 }
     58