Options
Menu

Class SpringController

Uses spring physics to animate the target object towards a position that is defined as the lookAtTarget object's position plus the vector defined by the positionOffset property.

Hierarchy

Index

Constructors

constructor

Properties

_pAutoUpdate

_pAutoUpdate: boolean

_pControllerDirty

_pControllerDirty: boolean

_pLookAtObject

_pLookAtObject: DisplayObject

_pLookAtPosition

_pLookAtPosition: Vector3D

_pOrigin

_pOrigin: Vector3D

_pTargetObject

_pTargetObject: DisplayObject

damping

damping: number

Damping is the spring internal friction, or how much it resists the "boinggggg" effect. Too high and you'll lose it! A number between 1 and 20 is recommended.

mass

mass: number

Mass of the camera, if over 120 and it'll be very heavy to move.

positionOffset

positionOffset: Vector3D

Offset of spring center from target in target object space, ie: Where the camera should ideally be in the target object space.

stiffness

stiffness: number

Stiffness of the spring, how hard is it to extend. The higher it is, the more "fixed" the cam will be. A number between 1 and 20 is recommended.

Accessors

autoUpdate

  • get (): boolean
  • set (val: boolean): void

lookAtObject

lookAtPosition

  • get (): Vector3D
  • set (val: Vector3D): void

targetObject

Methods

pNotifyUpdate

  • pNotifyUpdate(): void

update

  • update(interpolate?: boolean): void
  • Parameters

    • Default value interpolate: boolean = true

    Returns void

updateController

  • updateController(): void

Generated using TypeDoc