Options
All
  • Public
  • Public/Protected
  • All
Menu

A Rotation behavior that handles starting rotation, rotation speed, and rotational acceleration.

Example configuration:

{
"type": "rotation",
"config": {
"minStart": 0,
"maxStart": 180,
"minSpeed": 30,
"maxSpeed": 45,
"accel": 20
}
}

Hierarchy

  • RotationBehavior

Implements

Index

Constructors

  • new RotationBehavior(config: { accel: number; maxSpeed: number; maxStart: number; minSpeed: number; minStart: number }): RotationBehavior
  • Parameters

    • config: { accel: number; maxSpeed: number; maxStart: number; minSpeed: number; minStart: number }
      • accel: number

        Constant rotational acceleration of the particles, in degrees/second/second.

      • maxSpeed: number

        Maximum rotation speed of the particles, in degrees/second. Positive is counter-clockwise.

      • maxStart: number

        Maximum starting rotation of the particles, in degrees. 0 is facing right, 90 is upwards.

      • minSpeed: number

        Minimum rotation speed of the particles, in degrees/second. Positive is counter-clockwise.

      • minStart: number

        Minimum starting rotation of the particles, in degrees. 0 is facing right, 90 is upwards.

    Returns RotationBehavior

Properties

accel: number
maxSpeed: number
maxStart: number
minSpeed: number
minStart: number
order: BehaviorOrder = BehaviorOrder.Normal

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.

editorConfig: BehaviorEditorConfig = null
type: string = 'rotation'

Methods

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

Generated using TypeDoc