Merge pull request #43 from 2youyouo2/master

export Curve and Bezier helper
This commit is contained in:
Jare Guo
2015-12-14 11:30:50 +08:00
+8 -2
View File
@@ -163,7 +163,7 @@ Bezier.prototype.getUtoTmapping = function ( u, distance ) {
//console.log('b' , i, low, high, Date.now()- time);
if ( arcLengths[ i ] == targetArcLength ) {
if ( arcLengths[ i ] === targetArcLength ) {
var t = i / ( il - 1 );
return t;
@@ -216,6 +216,10 @@ function sampleMotionPaths (motionPaths, data, duration, fps) {
var values = data.values;
if (motionPaths.length === 0 || values.length === 0) {
return;
}
values = values.map(function (value) {
return v2(value[0], value[1]);
});
@@ -323,5 +327,7 @@ if (CC_TEST) {
}
module.exports = {
sampleMotionPaths: sampleMotionPaths
sampleMotionPaths: sampleMotionPaths,
Curve: Curve,
Bezier: Bezier
};