C# Class Nez.Tweens.TransformSpringTween

Inheritance: AbstractTweenable
Show file Open project: prime31/Nez

Public Properties

Property Type Description
angularFrequency float
dampingRatio float

Public Methods

Method Description
TransformSpringTween ( Transform transform, TransformTargetType targetType, Vector2 targetValue ) : Microsoft.Xna.Framework

Initializes a new instance of the Prime31.ZestKit.TransformSpringTween class.

setTargetValue ( Vector2 targetValue ) : void

you can call setTargetValue at any time to reset the target value to a new Vector2. If you have not called start to add the spring tween it will be called for you.

setTweenedValue ( Vector2 value ) : void
tick ( ) : bool
updateDampingRatioWithHalfLife ( float lambda ) : void

lambda should be the desired duration when the oscillation magnitude is reduced by 50%

Private Methods

Method Description
getCurrentValueOfTweenedTargetType ( ) : Vector2

Method Details

TransformSpringTween() public method

Initializes a new instance of the Prime31.ZestKit.TransformSpringTween class.
public TransformSpringTween ( Transform transform, TransformTargetType targetType, Vector2 targetValue ) : Microsoft.Xna.Framework
transform Transform Transform.
targetType TransformTargetType
targetValue Vector2
return Microsoft.Xna.Framework

setTargetValue() public method

you can call setTargetValue at any time to reset the target value to a new Vector2. If you have not called start to add the spring tween it will be called for you.
public setTargetValue ( Vector2 targetValue ) : void
targetValue Vector2 Target value.
return void

setTweenedValue() public method

public setTweenedValue ( Vector2 value ) : void
value Vector2
return void

tick() public method

public tick ( ) : bool
return bool

updateDampingRatioWithHalfLife() public method

lambda should be the desired duration when the oscillation magnitude is reduced by 50%
public updateDampingRatioWithHalfLife ( float lambda ) : void
lambda float Lambda.
return void

Property Details

angularFrequency public property

An angular frequency of 2pi (radians per second) means the oscillation completes one full period over one second, i.e. 1Hz. should be less than 35 or so to remain stableThe angular frequency.
public float angularFrequency
return float

dampingRatio public property

lower values are less damped and higher values are more damped resulting in less springiness. should be between 0.01f, 1f to avoid unstable systems.
public float dampingRatio
return float