Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ElasticToActorStrategy

Using Hook's law, elastically move the camera towards the target actor.

Hierarchy

  • ElasticToActorStrategy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • If cameraElasticity < cameraFriction < 1.0, the behavior will be a dampened spring that will slowly end at the target without bouncing If cameraFriction < cameraElasticity < 1.0, the behavior will be an oscillating spring that will over correct and bounce around the target

    Parameters

    • target: Actor

      Target actor to elastically follow

    • cameraElasticity: number

      The higher the elasticity the more force that will drive the camera towards the target

    • cameraFriction: number

      The higher the friction the more that the camera will resist motion towards the target

    Returns ElasticToActorStrategy

Properties

cameraElasticity

cameraElasticity: number

The higher the elasticity the more force that will drive the camera towards the target

cameraFriction

cameraFriction: number

The higher the friction the more that the camera will resist motion towards the target

target

target: Actor

Target actor to elastically follow

Methods

action