mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-22 01:55:25 -04:00
8338ab666d
Don't show in changelog
25 lines
812 B
JavaScript
25 lines
812 B
JavaScript
describe('gdjs.Polygon', function() {
|
|
it('benchmark gdjs.Polygon.collisionTest between two polygons', function() {
|
|
this.timeout(20000);
|
|
var rect1 = gdjs.Polygon.createRectangle(32, 40);
|
|
var rect2 = gdjs.Polygon.createRectangle(32, 40);
|
|
var rect3 = gdjs.Polygon.createRectangle(32, 40);
|
|
rect2.move(20, 20);
|
|
rect3.move(50, 50);
|
|
|
|
const benchmarkSuite = makeBenchmarkSuite({
|
|
benchmarksCount: 20,
|
|
iterationsCount: 30000,
|
|
});
|
|
benchmarkSuite
|
|
.add('collisionTest between two overlapping rectangles', i => {
|
|
gdjs.Polygon.collisionTest(rect1, rect2, false);
|
|
})
|
|
.add('collisionTest between two non overlapping rectangles', i => {
|
|
gdjs.Polygon.collisionTest(rect1, rect3, false);
|
|
});
|
|
|
|
console.log(benchmarkSuite.run());
|
|
});
|
|
});
|