Module technology.sola.engine
Class ParticleEmitterShape
java.lang.Object
technology.sola.engine.physics.component.particle.emitter.ParticleEmitterShape
- Direct Known Subclasses:
CircleEmitterShape,RectangleEmitterShape,TrapezoidEmitterShape,TriangleEmitterShape
ParticleEmitterShape defines the API for a particle emission shape to be used
in
ParticleEmissionConfiguration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Vector2DbooleanbooleanCalculates the position and direction details for the next particle emitted.protected abstract Vector2Dprotected abstract Vector2DsetEmitFromShell(boolean emitFromShell) Sets whether particles should only be emitted from the shell of the shape.setRandomDirection(boolean randomDirection) Sets whether particles should be emitted in a random direction.
-
Constructor Details
-
ParticleEmitterShape
public ParticleEmitterShape()
-
-
Method Details
-
nextEmission
Calculates the position and direction details for the next particle emitted.- Returns:
- the
EmissionDetailsfor the next particle emitted.
-
isEmitFromShell
public boolean isEmitFromShell()- Returns:
- true if particles should only be emitted from the shell of the shape
-
setEmitFromShell
Sets whether particles should only be emitted from the shell of the shape.- Parameters:
emitFromShell- true if particles should only be emitted from the shell of the shape- Returns:
- this
-
isRandomDirection
public boolean isRandomDirection()- Returns:
- true if particles should be emitted in a random direction
-
setRandomDirection
Sets whether particles should be emitted in a random direction. Otherwise, particles will be emitted away from the shape's center.- Parameters:
randomDirection- true if particles should be emitted in a random direction- Returns:
- this
-
getCenter
- Returns:
- the center point of the shape
-
randomPointInShape
- Returns:
- a random point inside the shape
-
randomPointOnPerimeter
- Returns:
- a random point on the perimeter of the shape
-