Home | History | Annotate | Download | only in values
      1 package com.badlogic.gdx.graphics.g3d.particles.values;
      2 
      3 import com.badlogic.gdx.math.Vector3;
      4 
      5 /** Encapsulate the formulas to spawn a particle on a point shape.
      6  * @author Inferno */
      7 public final class PointSpawnShapeValue extends PrimitiveSpawnShapeValue {
      8 
      9 	public PointSpawnShapeValue (PointSpawnShapeValue value) {
     10 		super(value);
     11 		load(value);
     12 	}
     13 
     14 	public PointSpawnShapeValue () {}
     15 
     16 	@Override
     17 	public void spawnAux (Vector3 vector, float percent) {
     18 		vector.x = spawnWidth + (spawnWidthDiff * spawnWidthValue.getScale(percent));
     19 		vector.y = spawnHeight + (spawnHeightDiff * spawnHeightValue.getScale(percent));
     20 		vector.z = spawnDepth + (spawnDepthDiff * spawnDepthValue.getScale(percent));
     21 	}
     22 
     23 	@Override
     24 	public SpawnShapeValue copy () {
     25 		return new PointSpawnShapeValue(this);
     26 	}
     27 }
     28