java.lang.Object
technology.sola.engine.physics.component.particle.emitter.ParticleEmitterShape
technology.sola.engine.physics.component.particle.emitter.RectangleEmitterShape

@NullMarked public class RectangleEmitterShape extends ParticleEmitterShape
RectangleEmitterShape is a ParticleEmitterShape that emits particles in the shape of a rectangle.
  • Constructor Details

    • RectangleEmitterShape

      public RectangleEmitterShape(int width, int height)
      Creates a RectangleEmitterShape with the desired width and height.
      Parameters:
      width - the width of the rectangle
      height - the height of the rectangle
  • Method Details

    • getWidth

      public int getWidth()
      Returns:
      the width of the rectangle
    • getHeight

      public int getHeight()
      Returns:
      the height of the rectangle
    • setSize

      public RectangleEmitterShape setSize(int width, int height)
      Sets the size of the rectangle.
      Parameters:
      width - the new width of the rectangle
      height - the new height of the rectangle
      Returns:
      this
    • getCenter

      protected Vector2D getCenter()
      Specified by:
      getCenter in class ParticleEmitterShape
      Returns:
      the center point of the shape
    • randomPointInShape

      protected Vector2D randomPointInShape()
      Specified by:
      randomPointInShape in class ParticleEmitterShape
      Returns:
      a random point inside the shape
    • randomPointOnPerimeter

      protected Vector2D randomPointOnPerimeter()
      Specified by:
      randomPointOnPerimeter in class ParticleEmitterShape
      Returns:
      a random point on the perimeter of the shape