function savePathCatmullRom(path, frame) {
    if (!path) {
        return;
    }
    var length = path.length;
    var outPath = [];
    for (var i = 0; i < length - 1; i += 1) {
        // var ui = 0;
        for (var u = 0; u < 1; u += 1 / frame) {
            // var vec = new Vector();
            var vec = interpolatedPosition(
            //call to Catmull-Rom
            path[Math.max(0, i - 1)], // safe array steps
            path[i], path[Math.min(i + 1, length - 1)], // safe Array steps
            path[Math.min(i + 2, length - 1)], // safe Array steps
            u);
            outPath.push(vec); //store each value
            nodesLeft += 1; // increment node counter
            // ui++;
        }
    }
    return outPath;
}
// main function to calculate the Path
main function to calculate the Path
main function to calculate the Path
function savePathCatmullRom(path, frame) {
    if (!path) {
        return;
    }
    var length = path.length;
    var outPath = [];
    for (var i = 0; i < length - 1; i += 1) {
        for (var u = 0; u < 1; u += 1 / frame) {
            var vec = interpolatedPosition(
            path[Math.max(0, i - 1)], 
            path[i], path[Math.min(i + 1, length - 1)], 
            path[Math.min(i + 2, length - 1)], 
            u);
            outPath.push(vec); 
            nodesLeft += 1; 
        }
    }
    return outPath;
}
function savePathCatmullRom ( path , frame ) { if ( ! path ) { return ; } var length = path . length ; var outPath = [ ] ; for ( var i = 0 ; i < length - 1 ; i += 1 ) { for ( var u = 0 ; u < 1 ; u += 1 / frame ) { var vec = interpolatedPosition ( path [ Math . max ( 0 , i - 1 ) ] , path [ i ] , path [ Math . min ( i + 1 , length - 1 ) ] , path [ Math . min ( i + 2 , length - 1 ) ] , u ) ; outPath . push ( vec ) ; nodesLeft += 1 ; } } return outPath ; }
main function to calculate the Path
main function to calculate the Path
// var ui = 0; // var vec = new Vector(); //call to Catmull-Rom // safe array steps // safe Array steps // safe Array steps //store each value // increment node counter // ui++;