Class ParticleEffect
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.ParticleEffect
-
- All Implemented Interfaces:
ResourceData.Configurable,Disposable
public class ParticleEffect extends java.lang.Object implements Disposable, ResourceData.Configurable
It's a set of particles controllers. It can be updated, rendered, transformed which means the changes will be applied on all the particles controllers.
-
-
Constructor Summary
Constructors Constructor Description ParticleEffect()ParticleEffect(ParticleController... emitters)ParticleEffect(ParticleEffect effect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParticleEffectcopy()voiddispose()Releases all resources of this object.voiddraw()voidend()ParticleControllerfindController(java.lang.String name)Returns the controller with the specified name, or null.BoundingBoxgetBoundingBox()Array<ParticleController>getControllers()voidinit()booleanisComplete()voidload(AssetManager assetManager, ResourceData data)Loads all the assets required by all the controllers inside this effect.voidreset()voidrotate(Quaternion rotation)Applies the rotation to the current transformation matrix of each controller.voidrotate(Vector3 axis, float angle)Applies the rotation by the given angle around the given axis to the current transformation matrix of each controller.voidsave(AssetManager assetManager, ResourceData data)Saves all the assets required by all the controllers inside this effect.voidscale(float scaleX, float scaleY, float scaleZ)Applies the scale to the current transformation matrix of each controller.voidscale(Vector3 scale)Applies the scale to the current transformation matrix of each controller.voidsetBatch(Array<ParticleBatch<?>> batches)Assign one batch, among those passed in, to each controller.voidsetTransform(Matrix4 transform)Sets the given transform matrix on each controller.voidstart()voidtranslate(Vector3 translation)Applies the translation to the current transformation matrix of each controller.voidupdate()voidupdate(float deltaTime)
-
-
-
Constructor Detail
-
ParticleEffect
public ParticleEffect()
-
ParticleEffect
public ParticleEffect(ParticleEffect effect)
-
ParticleEffect
public ParticleEffect(ParticleController... emitters)
-
-
Method Detail
-
init
public void init()
-
start
public void start()
-
end
public void end()
-
reset
public void reset()
-
update
public void update()
-
update
public void update(float deltaTime)
-
draw
public void draw()
-
isComplete
public boolean isComplete()
-
setTransform
public void setTransform(Matrix4 transform)
Sets the given transform matrix on each controller.
-
rotate
public void rotate(Quaternion rotation)
Applies the rotation to the current transformation matrix of each controller.
-
rotate
public void rotate(Vector3 axis, float angle)
Applies the rotation by the given angle around the given axis to the current transformation matrix of each controller.- Parameters:
axis- the rotation axisangle- the rotation angle in degrees
-
translate
public void translate(Vector3 translation)
Applies the translation to the current transformation matrix of each controller.
-
scale
public void scale(float scaleX, float scaleY, float scaleZ)Applies the scale to the current transformation matrix of each controller.
-
scale
public void scale(Vector3 scale)
Applies the scale to the current transformation matrix of each controller.
-
getControllers
public Array<ParticleController> getControllers()
- Returns:
- all particle controllers.
-
findController
public ParticleController findController(java.lang.String name)
Returns the controller with the specified name, or null.
-
dispose
public void dispose()
Description copied from interface:DisposableReleases all resources of this object.- Specified by:
disposein interfaceDisposable
-
getBoundingBox
public BoundingBox getBoundingBox()
- Returns:
- the merged bounding box of all controllers.
-
setBatch
public void setBatch(Array<ParticleBatch<?>> batches)
Assign one batch, among those passed in, to each controller. The batch must be compatible with the controller to be assigned.
-
copy
public ParticleEffect copy()
- Returns:
- a copy of this effect, should be used after the particle effect has been loaded.
-
save
public void save(AssetManager assetManager, ResourceData data)
Saves all the assets required by all the controllers inside this effect.- Specified by:
savein interfaceResourceData.Configurable
-
load
public void load(AssetManager assetManager, ResourceData data)
Loads all the assets required by all the controllers inside this effect.- Specified by:
loadin interfaceResourceData.Configurable
-
-