Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Particle

Hierarchy

  • Particle

Index

Constructors

constructor

  • new Particle(position: Vector, oldPosition: Vector, heax: Heax, info?: { color?: string; hidden?: boolean; mass?: number; pinned?: boolean; radius?: number }): Particle
  • Parameters

    • position: Vector

      Current position of particle

    • oldPosition: Vector

      Position of particle right before it achieved current position

    • heax: Heax

      Instance of heax class

    • info: { color?: string; hidden?: boolean; mass?: number; pinned?: boolean; radius?: number } = {}

      Info about the particle

      • Optional color?: string
      • Optional hidden?: boolean
      • Optional mass?: number
      • Optional pinned?: boolean
      • Optional radius?: number

    Returns Particle

Properties

color

color: string

Color of the particle

heax

heax: Heax

Instance of heax class

hidden

hidden: boolean

If true the particle will not be rendered on the canvas

mass

mass: number

Mass of the particle

oldPosition

oldPosition: Vector

Position of particle right before it achieved current position

pinned

pinned: boolean

If true the particle will be pinned to the current position.

position

position: Vector

Current position of particle

radius

radius: number

Radius of the particle

velocity

velocity: Vector

Velocity of the particle (current position - old position)

Methods

constrain

render

update

Generated using TypeDoc