View source
class SpringController
package away3d.controllers
extends LookAtController › ControllerBase
Available on all platforms
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.
Constructor
new(?targetObject:Entity, ?lookAtObject:ObjectContainer3D, stiffness:Float = 1, mass:Float = 40, damping:Float = 4)
Variables
damping:Float
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.
positionOffset:Vector3D = new Vector3D(0, 500, -1000)
Offset of spring center from target in target object space, ie: Where the camera should ideally be in the target object space.
stiffness:Float
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.