exports.findSeparatingAxis = function(test){ var axis = vec2.create(); Narrowphase.findSeparatingAxis(convex,[0,0],0,convex,[0,1+eps],0,axis); // Check length var l = vec2.length(axis); test.ok(l > 1-eps); test.ok(l < 1+eps); // Check direction - should be quite near up/down direction var d = vec2.dot(axis, [0,1]); test.ok(Math.abs(d) > 1-eps); // Check what happens if there is overlap Narrowphase.findSeparatingAxis(convex,[0,0],0,convex,[0,0.5],0,axis); // Check direction - should still be quite near up/down direction var d = vec2.dot(axis, [0,1]); test.ok(Math.abs(d) > 1-eps); // Check what happens if there is diagonal overlap Narrowphase.findSeparatingAxis(convex,[0,0],0,convex,[0.5,0.5],0,axis); // Check direction var d = vec2.dot(axis, vec2.normalize([1,1],[1,1])); test.ok(Math.abs(d) > 1-eps); test.done(); };
setZeroForce: function(test){ var b = new Body({ force:[1,2], angularForce:3 }); b.setZeroForce(); test.equal(vec2.length(b.force),0); test.equal(b.angularForce,0); test.done(); },
gulp.task('indexPage', function() { var book = require(path.join(__dirname, 'crust', 'plugins', 'length.js')); var bookLength = book.length(); var contentString = ''; for (var index = 1; index <= bookLength; index++) { contentString += "<div class='page'>" + "<iframe src='/build/renders/page-" + index + ".html'>" + "</iframe></div>"; } var packageJson = JSON.parse(fs.readFileSync('package.json').toString()); var bookname = packageJson.name; var templateData = { CONTENT: contentString, BOOKNAME: bookname }; gulp.src(path.join('.', 'crust', 'index-template.html')) .pipe(handlebars(templateData, {})) .pipe(concat('index.html')) .pipe(gulp.dest('.')) .pipe(browserSync.stream()); });
.action(function() { try { console.log(book.length()); } catch (ex) { console.error(ex.stack); } }).on('--help', function() {
test(`Paths are only added once to the queue`, () => { loader.enqueue(`/about/me/`) loader.enqueue(`/about/`) loader.enqueue(`/about/`) loader.enqueue(`/about/me/`) loader.enqueue(`/about/`) loader.enqueue(`/about/me/`) expect(loader.length()).toEqual(2) })
length : function(){ return V3Math.length(this); },
it('Should get length', () => { const note = new Note(8, 2); expect(note.length()).toBe(2); });