mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Merge pull request #43 from 2youyouo2/master
export Curve and Bezier helper
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user