var isect = require('./ray-aabb');
var Suite = require('benchmark').Suite;

var suite = new Suite();

var boxa = [
  [-1, -1, -1],
  [ 1,  1,  1]
];
var origina = [-2, 0, 0];
var dira = [1, 0, 0];
var idira = [1, Infinity, Infinity]
var neara = 0;
var fara = 10;

suite.add('raycast along x axis', function() {
  isect(origina, dira, idira, boxa, neara, fara);
})

suite.on('cycle', function(event) {
  console.log(String(event.target));
});

suite.on('complete', function() {
  console.log('Fastest is ' + this.filter('fastest').pluck('name'));
});

suite.run();

@@ -257,16 +257,59 @@
  = 10;%0A%0A
+%0Avar ray = isect.createRay(origina, dira);%0A
 suite.ad
@@ -359,46 +359,16 @@
 ect(
-origina, dira, idira, boxa, neara, far
+ray, box
 a);%0A

update how benchmark creates rays