Skip to main content

ElasticToActorStrategy

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

Implements

Index

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

      [0 - 1.0] The higher the elasticity the more force that will drive the camera towards the target

    • cameraFriction: number

      [0 - 1.0] The higher the friction the more that the camera will resist motion towards the target

    Returns ElasticToActorStrategy

Properties

publiccameraElasticity

cameraElasticity: number

[0 - 1.0] The higher the elasticity the more force that will drive the camera towards the target

publiccameraFriction

cameraFriction: number

[0 - 1.0] The higher the friction the more that the camera will resist motion towards the target

publictarget

target: Actor

Target actor to elastically follow

Methods

publicaction

  • Parameters

    Returns Vector