Module technology.sola.engine
Class TrapezoidEmitterShape
java.lang.Object
technology.sola.engine.physics.component.particle.emitter.ParticleEmitterShape
technology.sola.engine.physics.component.particle.emitter.TrapezoidEmitterShape
TrapezoidEmitterShape is a
ParticleEmitterShape that emits particles in the shape of a trapezoid.-
Constructor Summary
ConstructorsConstructorDescriptionTrapezoidEmitterShape(Vector2D direction, float baseWidth, float height, float otherBaseWidth) Creates a TrapezoidEmitterShape. -
Method Summary
Modifier and TypeMethodDescriptionprotected Vector2DCalculates the position and direction details for the next particle emitted.protected Vector2Dprotected Vector2DsetEmitFromBase(boolean emitFromBase) Sets whether particles should be emitted from the first base of the trapezoid.Methods inherited from class technology.sola.engine.physics.component.particle.emitter.ParticleEmitterShape
isEmitFromShell, isRandomDirection, setEmitFromShell, setRandomDirection
-
Constructor Details
-
TrapezoidEmitterShape
public TrapezoidEmitterShape(Vector2D direction, float baseWidth, float height, float otherBaseWidth) Creates a TrapezoidEmitterShape. The direction is the vector going from the first base of the trapezoid towards the other base. The height is the distance between the two bases.Ex: direction (0, -1) + baseWidth 2 + height 5 + otherBaseWidth 8 ________ \ / \ / \__/
- Parameters:
direction- the direction of the trapezoidbaseWidth- the width of the first base of the trapezoidheight- the height of the trapezoidotherBaseWidth- the width of the second base of the trapezoid
-
-
Method Details
-
nextEmission
Description copied from class:ParticleEmitterShapeCalculates the position and direction details for the next particle emitted.- Overrides:
nextEmissionin classParticleEmitterShape- Returns:
- the
EmissionDetailsfor the next particle emitted.
-
setEmitFromBase
Sets whether particles should be emitted from the first base of the trapezoid.- Parameters:
emitFromBase- whether particles should be emitted from the first base of the trapezoid- Returns:
- this
-
getCenter
- Specified by:
getCenterin classParticleEmitterShape- Returns:
- the center point of the shape
-
randomPointInShape
- Specified by:
randomPointInShapein classParticleEmitterShape- Returns:
- a random point inside the shape
-
randomPointOnPerimeter
- Specified by:
randomPointOnPerimeterin classParticleEmitterShape- Returns:
- a random point on the perimeter of the shape
-