Class Particles2

Represents a 2D particle system

Hierarchy

Constructors

Properties

_localBoundingBox: BoundingBox2

Bounding box in this transform's local coordinate space

_localBoundingCircle: BoundingCircle

Bounding circle in this transform's local coordinate space

_position: Vector2

Vector2 representing the position

_rotation: number

Rotation of the transform in radians

_scale: Vector2

Vector2 representing the scale

_shear: null | Vector2
_worldBoundingBox: BoundingBox2

Bounding box in the world coordinate space

_worldBoundingCircle: BoundingCircle

Bounding box in the world coordinate space

baseParticle: Mesh2

The template shape used to render each particle.

boundingBox: BoundingBox2

Bounding box in vertex coordinate space

boundingCircle: BoundingCircle

Bounding circle in vertex coordinate space

children: Node2[]

Array of children for this transform

colorUniform: null | WebGLUniformLocation
gl: WebGL2RenderingContext
layer: number

Integer representing the layer of this transform

layerUniform: null | WebGLUniformLocation
localBoundsDirty: boolean
localMatrixDirty: boolean
localMatrixUpdated: boolean
localToParentMatrix: Matrix3

Matrix3 representing the transformation matrix in local space

localToWorldMatrix: Matrix3

Matrix3 representing the transformation matrix in world space

modelUniform: null | WebGLUniformLocation
numParticles: number

The number of particles to render.

parent: null | Node2

Parent transform for this transform

particlePositionAttribute: number
particlePositionBuffer: null | WebGLBuffer
particlePositions: Vector2[]

Array containing positions for each particle instance.

particleSizeAttribute: number
particleSizeBuffer: null | WebGLBuffer
particleSizes: number[]

Array containing sizes for each particle instance.

texCoordAttribute: number
textureUniform: null | WebGLUniformLocation
useTextureUniform: null | WebGLUniformLocation
vertColorAttribute: number
vertPositionAttribute: number
visible: boolean

Boolean indicating whether this transform should be rendered

worldBoundsDirty: boolean
worldMatrixDirty: boolean
shader: ShaderProgram = ...

Accessors

  • get rotation(): number
  • Returns number

  • set rotation(value: number): void
  • Parameters

    • value: number

    Returns void

Methods

  • Checks if this Node2 intersects another Node2, using either a BoundingCircle or AxisAlignedBoundingBox

    Returns

    A boolean indicating whether the two objects intersect

    Parameters

    • other: Node2

      The Node2 to check for intersection with

    • mode: IntersectionMode2 = IntersectionMode2.BOUNDING_CIRCLE

      The IntersectionMode2 to use for the comparison (default: BOUNDING_CIRCLE)

    • space: CoordinateSpace2 = CoordinateSpace2.LOCAL_SPACE

      The CoordinateSpace2 to use for the comparison (default: LOCAL_SPACE)

    Returns boolean

  • Removes the current Node2 from its parent

    Returns

    True if the Node2 was successfully removed, false otherwise

    Returns boolean

  • Removes the specified child Node2 from the current Node2

    Returns

    The removed Node2, or null if it was not found

    Parameters

    • child: Node2

      The child Node2 to remove

    Returns null | Node2

  • Traverses the scene graph starting from the current Node2 object

    Parameters

    • parentMatrixDirty: boolean = false

    Returns void

  • Update the particle positions and/or sizes

    Parameters

    • updatePositions: boolean = true

      Whether to update the particle positions (defaults to true)

    • updateSizes: boolean = false

      Whether to update the particle sizes (defaults to false)

    Returns void

Generated using TypeDoc