Constructors

  • The absorber constructor, initializes the absorber based on the given options and position

    Parameters

    • absorbers: Absorbers

      the Absorbers collection manager that will contain this absorber

    • container: Container

      the Container engine using the absorber plugin, containing the particles that will interact with this Absorber

    • engine: Engine

      the Engine instance that will be used for calculating the Absorber interactions

    • options: RecursivePartial<IAbsorber>

      the Absorber source options

    • Optionalposition: ICoordinates

      the Absorber optional position, if not given, it will be searched in options, and if not available also there, a random one will be used

    Returns AbsorberInstance

Properties

color: IRgb

The absorber color

The absorber size limit

mass: number

The absorber mass, this increases the attraction force

name?: string

The absorber name, useful when retrieving it manually

opacity: number

The absorber opacity

position: Vector

The absorber position

size: number

The absorber size, great size doesn't mean great mass, it depends also on the density

Methods

  • Absorber attraction interaction, attract the particle to the absorber

    Parameters

    • particle: OrbitingParticle

      the particle to attract to the absorber

    Returns void

  • The draw method, for drawing the absorber in the canvas

    Parameters

    • context: CanvasRenderingContext2D

      the canvas 2d context used for drawing

    Returns void