Options
All
  • Public
  • Public/Protected
  • All
Menu

A Movement behavior that handles movement by applying a constant acceleration to all particles.

Example configuration:

{
"type": "moveAcceleration",
"config": {
"accel": {
"x": 0,
"y": 2000
},
"minStart": 600,
"maxStart": 600,
"rotate": true
}
}

Hierarchy

  • AccelerationBehavior

Implements

Index

Constructors

  • new AccelerationBehavior(config: { accel: { x: number; y: number }; maxSpeed?: number; maxStart: number; minStart: number; rotate?: boolean }): AccelerationBehavior
  • Parameters

    • config: { accel: { x: number; y: number }; maxSpeed?: number; maxStart: number; minStart: number; rotate?: boolean }
      • accel: { x: number; y: number }

        Constant acceleration, in the coordinate space of the particle parent, in world units/second.

        • x: number
        • y: number
      • Optional maxSpeed?: number

        Maximum linear speed. 0 is unlimited. Defaults to 0.

      • maxStart: number

        Maximum speed when initializing the particle. in world units/second.

      • minStart: number

        Minimum speed when initializing the particle, in world units/second.

      • Optional rotate?: boolean

        Rotate the particle with its direction of movement. While initial movement direction reacts to rotation settings, this overrides any dynamic rotation. Defaults to false.

    Returns AccelerationBehavior

Properties

accel: { x: number; y: number }

Type declaration

  • x: number
  • y: number
maxSpeed: number
maxStart: number
minStart: number
order: BehaviorOrder = BehaviorOrder.Late

Order in which the behavior will be handled. Lower numbers are handled earlier, with an order of 0 getting special treatment before the Emitter's transformation is applied.

rotate: boolean
editorConfig: BehaviorEditorConfig = null
type: string = 'moveAcceleration'

Methods

  • updateParticle(particle: Particle, deltaSec: number): void

Generated using TypeDoc