Module technology.sola.engine
Class TriangleEmitterShape
java.lang.Object
technology.sola.engine.physics.component.particle.emitter.ParticleEmitterShape
technology.sola.engine.physics.component.particle.emitter.TriangleEmitterShape
TriangleEmitterShape is a
ParticleEmitterShape that emits particles in the shape of an Isoceles triangle.-
Constructor Summary
ConstructorsConstructorDescriptionTriangleEmitterShape(Vector2D direction, float height, float width) Creates a TriangleEmitterShape. -
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 base of the triangle (the isolated point).Methods inherited from class technology.sola.engine.physics.component.particle.emitter.ParticleEmitterShape
isEmitFromShell, isRandomDirection, setEmitFromShell, setRandomDirection
-
Constructor Details
-
TriangleEmitterShape
Creates a TriangleEmitterShape. The direction is the vector going from the isolated point of the triangle towards the non-equal side. The height is the distance the non-equal side is away from the isolated point, and the width is the width of the non-equal side.Ex: direction (0, -1) + height 3 + width 5 ______ \ / \ / \/
- Parameters:
direction- the direction of the triangleheight- the height of the trianglewidth- the width of the triangle
-
-
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 base of the triangle (the isolated point).- Parameters:
emitFromBase- whether particles should be emitted from the base of the triangle- 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
-