com.thelab.tween.TweenFunction
Class that holds all information about the tweening functions used by the Climv. It also gives the possibility to create custom functions.
static _function:Objectstatic function addEquation(name:String, c5:Number, c4:Number, c3:Number, c2:Number, c1:Number, reverse:Boolean, modifier:Function)Insert a new equation into the Class. The equation will be available for later use in the Climv Class.
name | Equation name |
c5 | 5th order coeficient of the polynom. |
c4 | 4th order coeficient of the polynom. |
c3 | 3rd order coeficient of the polynom. |
c2 | 2nd order coeficient of the polynom. |
c1 | 1st order coeficient of the polynom. |
modifier | modifirer constant that will be applied in the result. Modifier is a function that receives a number and make any kind of calculation on it before using it. |
static function addWaveEquation(func:Function, name:String)Insert a new custom equation for wave tweenings. Wave functions has templates like that wave(func:String,angle:Number,range:Number,offset:Number):Number
func | Function reference. |
name | Name of the function. |
static function solve(coef:Array, value:Number):NumberReceives an Array of coeficients and a value then solve the polynom.
coef | Array with 5 coeficients and 1 modifier in the end. |
value | The value that will be applied in the formula. |
Number - The result of the polynom.
static function wave(angle:Number, range:Number, offset:Number, phase:Number, scale:Number, func:Function):NumberReceives the name of wave function an angle the result range and offset. Returns the waving value for it.
range | Maximum range of the result. |
offset | Starting offset of the result. |
func | Wave function name. |
Number - Result.
static function catmull(ratio:Number, p0, p1, p2, p3):ObjectSolve the Catmull Curve between 2 points (P1 and P2) with 2 control points ( P0 and P3)
ratio | Normalized value to interpolate between the 2 points. |
p0 | Control Point 1 |
p1 | Point 1 |
p2 | Point 2 |
p3 | Control Point 2 |
Object - Point with the interpolated point between P1 and P2