Comparing version 0.1.1 to 0.2.0
@@ -0,1 +1,5 @@ | ||
## 0.2.0 / 2020-02-18 | ||
- [FEATURE] Added `translate` to circle to easily modify the position like the polygon version. | ||
- [TEST] Added testing for circle and polygon translations. | ||
## 0.1.1 / 2020-02-18 | ||
@@ -2,0 +6,0 @@ - [MISC] Replaced rollup-plugin-commonjs and rollup-plugin-node-resolve with @rollup/plugin-commonjs and @rollup/plugin-node-resolve. |
@@ -481,3 +481,3 @@ function _classCallCheck(instance, Constructor) { | ||
* @param {Array<Vector>} points An array of vectors representing the points in the polygon, in counter-clockwise order. | ||
* | ||
* * | ||
* @returns {Polygon} Returns this for chaining. | ||
@@ -721,2 +721,24 @@ */ | ||
/** | ||
* **Note:** Not sure if this will be kept or not but for now it's disabled. | ||
* | ||
* Sets a new position for this polygon and recalculates the points. | ||
* | ||
* @param {Vector} position A Vector representing the new position of this polygon. | ||
*/ | ||
// set position(position: Vector) { | ||
// const diffX: number = -(this._position.x - position.x); | ||
// const diffY: number = -(this._position.y - position.y); | ||
// const diffPoint: Vector = new Vector(diffX, diffY); | ||
// const points: Array<Vector> = []; | ||
// this._points.map((point: Vector) => { | ||
// const tempX: number = point.x; | ||
// const tempY: number = point.y; | ||
// const tempPoint: Vector = new Vector(tempX, tempY); | ||
// const calculatedPoint: Vector = tempPoint.add(diffPoint); | ||
// points.push(calculatedPoint); | ||
// }); | ||
// this.setPoints(points, true); | ||
// } | ||
/** | ||
* Returns the points of this polygon. | ||
@@ -927,5 +949,14 @@ * | ||
_createClass(Circle, [{ | ||
key: "getAABB", | ||
key: "translate", | ||
/** | ||
* Translate the center of the cirlc.e | ||
* | ||
* @param {Vector} position A Vector representing the new center of this circle. | ||
*/ | ||
value: function translate(x, y) { | ||
this._position.x += x; | ||
this._position.y += y; | ||
} | ||
/** | ||
* Compute the axis-aligned bounding box (AABB) of this Circle. | ||
@@ -937,2 +968,5 @@ * | ||
*/ | ||
}, { | ||
key: "getAABB", | ||
value: function getAABB() { | ||
@@ -939,0 +973,0 @@ var corner = this._position.clone().add(this._offset).sub(new Vector(this._radius, this._radius)); |
38
index.js
@@ -483,3 +483,3 @@ 'use strict'; | ||
* @param {Array<Vector>} points An array of vectors representing the points in the polygon, in counter-clockwise order. | ||
* | ||
* * | ||
* @returns {Polygon} Returns this for chaining. | ||
@@ -723,2 +723,24 @@ */ | ||
/** | ||
* **Note:** Not sure if this will be kept or not but for now it's disabled. | ||
* | ||
* Sets a new position for this polygon and recalculates the points. | ||
* | ||
* @param {Vector} position A Vector representing the new position of this polygon. | ||
*/ | ||
// set position(position: Vector) { | ||
// const diffX: number = -(this._position.x - position.x); | ||
// const diffY: number = -(this._position.y - position.y); | ||
// const diffPoint: Vector = new Vector(diffX, diffY); | ||
// const points: Array<Vector> = []; | ||
// this._points.map((point: Vector) => { | ||
// const tempX: number = point.x; | ||
// const tempY: number = point.y; | ||
// const tempPoint: Vector = new Vector(tempX, tempY); | ||
// const calculatedPoint: Vector = tempPoint.add(diffPoint); | ||
// points.push(calculatedPoint); | ||
// }); | ||
// this.setPoints(points, true); | ||
// } | ||
/** | ||
* Returns the points of this polygon. | ||
@@ -929,5 +951,14 @@ * | ||
_createClass(Circle, [{ | ||
key: "getAABB", | ||
key: "translate", | ||
/** | ||
* Translate the center of the cirlc.e | ||
* | ||
* @param {Vector} position A Vector representing the new center of this circle. | ||
*/ | ||
value: function translate(x, y) { | ||
this._position.x += x; | ||
this._position.y += y; | ||
} | ||
/** | ||
* Compute the axis-aligned bounding box (AABB) of this Circle. | ||
@@ -939,2 +970,5 @@ * | ||
*/ | ||
}, { | ||
key: "getAABB", | ||
value: function getAABB() { | ||
@@ -941,0 +975,0 @@ var corner = this._position.clone().add(this._offset).sub(new Vector(this._radius, this._radius)); |
@@ -65,2 +65,8 @@ import Vector from './Vector'; | ||
/** | ||
* Translate the center of the cirlc.e | ||
* | ||
* @param {Vector} position A Vector representing the new center of this circle. | ||
*/ | ||
translate(x: number, y: number): void; | ||
/** | ||
* Compute the axis-aligned bounding box (AABB) of this Circle. | ||
@@ -67,0 +73,0 @@ * |
@@ -83,5 +83,14 @@ 'use strict'; | ||
_createClass(Circle, [{ | ||
key: "getAABB", | ||
key: "translate", | ||
/** | ||
* Translate the center of the cirlc.e | ||
* | ||
* @param {Vector} position A Vector representing the new center of this circle. | ||
*/ | ||
value: function translate(x, y) { | ||
this._position.x += x; | ||
this._position.y += y; | ||
} | ||
/** | ||
* Compute the axis-aligned bounding box (AABB) of this Circle. | ||
@@ -93,2 +102,5 @@ * | ||
*/ | ||
}, { | ||
key: "getAABB", | ||
value: function getAABB() { | ||
@@ -155,2 +167,2 @@ var corner = this._position.clone().add(this._offset).sub(new _Vector["default"](this._radius, this._radius)); | ||
exports["default"] = Circle; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nZW9tZXRyeS9DaXJjbGUudHMiXSwibmFtZXMiOlsiQ2lyY2xlIiwicG9zaXRpb24iLCJWZWN0b3IiLCJyYWRpdXMiLCJfcG9zaXRpb24iLCJfcmFkaXVzIiwiY29ybmVyIiwiY2xvbmUiLCJhZGQiLCJfb2Zmc2V0Iiwic3ViIiwiQm94IiwidG9Qb2x5Z29uIiwib2Zmc2V0Il0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7OztBQUVBOztBQUNBOzs7Ozs7Ozs7Ozs7QUFHQTs7Ozs7OztJQU9xQkEsTTs7O0FBQ25COzs7Ozs7OztBQVNBOzs7Ozs7OztBQVNBOzs7Ozs7OztBQVNBOzs7O0FBSUEsb0JBQWlFO0FBQUEsUUFBckRDLFFBQXFELHVFQUFsQyxJQUFJQyxrQkFBSixFQUFrQztBQUFBLFFBQXBCQyxNQUFvQix1RUFBSCxDQUFHOztBQUFBOztBQUFBLHVDQXhCckMsSUFBSUQsa0JBQUosRUF3QnFDOztBQUFBLHFDQWZ2QyxDQWV1Qzs7QUFBQSxxQ0FOdkMsSUFBSUEsa0JB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mVyLCB0aGlzLl9yYWRpdXMgKiAyLCB0aGlzLl9yYWRpdXMgKiAyKS50b1BvbHlnb24oKTtcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFNldCB0aGUgY3VycmVudCBvZmZzZXQgdG8gYXBwbHkgdG8gdGhlIHJhZGl1cy5cclxuICAgKiBcclxuICAgKiBAcGFyYW0ge1ZlY3Rvcn0gb2Zmc2V0IFRoZSBuZXcgb2Zmc2V0IFZlY3Rvci5cclxuICAgKiBcclxuICAgKiBAcmV0dXJucyB7Q2lyY2xlfSBSZXR1cm5zIHRoaXMgZm9yIGNoYWluaW5nLlxyXG4gICAqL1xyXG4gIHNldE9mZnNldChvZmZzZXQ6IFZlY3Rvcik6IENpcmNsZSB7XHJcbiAgICB0aGlzLl9vZmZzZXQgPSBvZmZzZXQ7XHJcblxyXG4gICAgcmV0dXJuIHRoaXM7XHJcbiAgfVxyXG59Il19 |
@@ -82,2 +82,9 @@ import Vector from './Vector'; | ||
/** | ||
* **Note:** Not sure if this will be kept or not but for now it's disabled. | ||
* | ||
* Sets a new position for this polygon and recalculates the points. | ||
* | ||
* @param {Vector} position A Vector representing the new position of this polygon. | ||
*/ | ||
/** | ||
* Returns the points of this polygon. | ||
@@ -126,3 +133,3 @@ * | ||
* @param {Array<Vector>} points An array of vectors representing the points in the polygon, in counter-clockwise order. | ||
* | ||
* * | ||
* @returns {Polygon} Returns this for chaining. | ||
@@ -129,0 +136,0 @@ */ |
@@ -137,3 +137,3 @@ 'use strict'; | ||
* @param {Array<Vector>} points An array of vectors representing the points in the polygon, in counter-clockwise order. | ||
* | ||
* * | ||
* @returns {Polygon} Returns this for chaining. | ||
@@ -377,2 +377,24 @@ */ | ||
/** | ||
* **Note:** Not sure if this will be kept or not but for now it's disabled. | ||
* | ||
* Sets a new position for this polygon and recalculates the points. | ||
* | ||
* @param {Vector} position A Vector representing the new position of this polygon. | ||
*/ | ||
// set position(position: Vector) { | ||
// const diffX: number = -(this._position.x - position.x); | ||
// const diffY: number = -(this._position.y - position.y); | ||
// const diffPoint: Vector = new Vector(diffX, diffY); | ||
// const points: Array<Vector> = []; | ||
// this._points.map((point: Vector) => { | ||
// const tempX: number = point.x; | ||
// const tempY: number = point.y; | ||
// const tempPoint: Vector = new Vector(tempX, tempY); | ||
// const calculatedPoint: Vector = tempPoint.add(diffPoint); | ||
// points.push(calculatedPoint); | ||
// }); | ||
// this.setPoints(points, true); | ||
// } | ||
/** | ||
* Returns the points of this polygon. | ||
@@ -449,2 +471,2 @@ * | ||
exports["default"] = Polygon; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nZW9tZXRyeS9Qb2x5Z29uLnRzIl0sIm5hbWVzIjpbIlBvbHlnb24iLCJwb3NpdGlvbiIsIlZlY3RvciIsInBvaW50cyIsIl9wb3NpdGlvbiIsInNldFBvaW50cyIsImxlbmd0aENoYW5nZWQiLCJsZW5ndGgiLCJpIiwiY2FsY1BvaW50cyIsIl9jYWxjUG9pbnRzIiwiZWRnZXMiLCJfZWRnZXMiLCJub3JtYWxzIiwiX25vcm1hbHMiLCJwMSIsInAyIiwieCIsInkiLCJzcGxpY2UiLCJwdXNoIiwiX3BvaW50cyIsIl9yZWNhbGMiLCJhbmdsZSIsIl9hbmdsZSIsIm9mZnNldCIsIl9vZmZzZXQiLCJsZW4iLCJyb3RhdGUiLCJjYWxjUG9pbnQiLCJjb3B5IiwiZSIsInN1YiIsInBlcnAiLCJub3JtYWxpemUiLCJ4TWluIiwieU1pbiIsInhNYXgiLCJ5TWF4IiwicG9pbnQiLCJCb3giLCJjbG9uZSIsImFkZCIsInRvUG9seWdvbiIsImN4IiwiY3kiLCJhciIsImEiXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7O0FBRUE7O0FBQ0E7Ozs7Ozs7Ozs7OztBQUVBOzs7Ozs7OztJQVFxQkEsTzs7O0FBQ25COzs7Ozs7OztBQVNBOz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HMgPSBbXTtcclxuICAgICAgY29uc3QgZWRnZXM6IEFycmF5PFZlY3Rvcj4gPSB0aGlzLl9lZGdlcyA9IFtdO1xyXG4gICAgICBjb25zdCBub3JtYWxzOiBBcnJheTxWZWN0b3I+ID0gdGhpcy5fbm9ybWFscyA9IFtdO1xyXG5cclxuICAgICAgLy8gQWxsb2NhdGUgdGhlIHZlY3RvciBhcnJheXMgZm9yIHRoZSBjYWxjdWxhdGVkIHByb3BlcnRpZXNcclxuICAgICAgZm9yIChpID0gMDsgaSA8IHBvaW50cy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgIC8vIFJlbW92ZSBjb25zZWN1dGl2ZSBkdXBsaWNhdGUgcG9pbnRzXHJcbiAgICAgICAgY29uc3QgcDE6IFZlY3RvciA9IHBvaW50c1tpXTtcclxuICAgICAgICBjb25zdCBwMjogVmVjdG9yID0gaSA8IHBvaW50cy5sZW5ndGggLSAxID8gcG9pbnRzW2kgKyAxXSA6IHBvaW50c1swXTtcclxuXHJcbiAgICAgICAgaWYgKHAxICE9PSBwMiAmJiBwMS54ID09PSBwMi54ICYmIHAxLnkgPT09IHAyLnkpIHtcclxuICAgICAgICAgIHBvaW50cy5zcGxpY2UoaSwgMSk7XHJcbiAgICAgICAgICBpIC09IDE7XHJcbiAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGNhbGNQb2ludHMucHVzaChuZXcgVmVjdG9yKCkpO1xyXG4gICAgICAgIGVkZ2VzLnB1c2gobmV3IFZlY3RvcigpKTtcclxuICAgICAgICBub3JtYWxzLnB1c2gobmV3IFZlY3RvcigpKTtcclxuICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHRoaXMuX3BvaW50cyA9IHBvaW50cztcclxuXHJcbiAgICB0aGlzLl9yZWNhbGMoKTtcclxuXHJcbiAgICByZXR1cm4gdGhpcztcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFNldCB0aGUgY3VycmVudCByb3Rhd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GUgdGhlIHZlY3RvciBhcnJheXMgZm9yIHRoZSBjYWxjdWxhdGVkIHByb3BlcnRpZXNcclxuICAgICAgZm9yIChpID0gMDsgaSA8IHBvaW50cy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgIC8vIFJlbW92ZSBjb25zZWN1dGl2ZSBkdXBsaWNhdGUgcG9pbnRzXHJcbiAgICAgICAgY29uc3QgcDE6IFZlY3RvciA9IHBvaW50c1tpXTtcclxuICAgICAgICBjb25zdCBwMjogVmVjdG9yID0gaSA8IHBvaW50cy5sZW5ndGggLSAxID8gcG9pbnRzW2kgKyAxXSA6IHBvaW50c1swXTtcclxuXHJcbiAgICAgICAgaWYgKHAxICE9PSBwMiAmJiBwMS54ID09PSBwMi54ICYmIHAxLnkgPT09IHAyLnkpIHtcclxuICAgICAgICAgIHBvaW50cy5zcGxpY2UoaSwgMSk7XHJcbiAgICAgICAgICBpIC09IDE7XHJcbiAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGNhbGNQb2ludHMucHVzaChuZXcgVmVjdG9yKCkpO1xyXG4gICAgICAgIGVkZ2VzLnB1c2gobmV3IFZlY3RvcigpKTtcclxuICAgICAgICBub3JtYWxzLnB1c2gobmV3IFZlY3RvcigpKTtcclxuICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHRoaXMuX3BvaW50cyA9IHBvaW50cztcclxuXHJcbiAgICB0aGlzLl9yZWNhbGMoKTtcclxuXHJcbiAgICByZXR1cm4gdGhpcztcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFNldCB0aGUgY3VycmVudCByb3RhdGlvbiBhbmdsZSBvZiB0aGUgcG9seWdvbi5cclxuICAgKiBcclxuICAgKiBAcGFyYW0ge251bWJlcn0gYW5nbGUgVGhlIGN1cnJlbnQgcm90YXRpb24gYW5nbGUgKGluIHJhZGlhbnMpLlxyXG4gICAqIFxyXG4gICAqIEByZXR1cm5zIHtQb2x5Z29ufSBSZXR1c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gaTogbnVtYmVyID0gMDsgaSA8IGxlbjsgaSsrKSB7XHJcbiAgICAgIGNvbnN0IHAxOiBWZWN0b3IgPSBwb2ludHNbaV07XHJcbiAgICAgIGNvbnN0IHAyOiBWZWN0b3IgPSBpID09PSBsZW4gLSAxID8gcG9pbnRzWzBdIDogcG9pbnRzW2kgKyAxXTsgLy8gTG9vcCBhcm91bmQgaWYgbGFzdCBwb2ludFxyXG5cclxuICAgICAgY29uc3QgYTogbnVtYmVyID0gcDFbXCJ4XCJdICogcDJbXCJ5XCJdIC0gcDJbXCJ4XCJdICogcDFbXCJ5XCJdO1xyXG5cclxuICAgICAgY3ggKz0gKHAxW1wieFwiXSArIHAyW1wieFwiXSkgKiBhO1xyXG4gICAgICBjeSArPSAocDFbXCJ5XCJdICsgcDJbXCJ5XCJdKSAqIGE7XHJcbiAgICAgIGFyICs9IGE7XHJcbiAgICB9XHJcblxyXG4gICAgYXIgPSBhciAqIDM7IC8vIHdlIHdhbnQgMSAvIDYgdGhlIGFyZWEgYW5kIHdlIGN1cnJlbnRseSBoYXZlIDIqYXJlYVxyXG4gICAgY3ggPSBjeCAvIGFyO1xyXG4gICAgY3kgPSBjeSAvIGFyO1xyXG5cclxuICAgIHJldHVybiBuZXcgVmVjdG9yKGN4LCBjeSk7XHJcbiAgfVxyXG59Il19 |
{ | ||
"name": "collider2d", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "A 2D collision checker for modern games.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -81,2 +81,12 @@ 'use strict' | ||
/** | ||
* Translate the center of the cirlc.e | ||
* | ||
* @param {Vector} position A Vector representing the new center of this circle. | ||
*/ | ||
translate(x: number, y: number) { | ||
this._position.x += x; | ||
this._position.y += y; | ||
} | ||
/** | ||
* Compute the axis-aligned bounding box (AABB) of this Circle. | ||
@@ -83,0 +93,0 @@ * |
@@ -99,2 +99,31 @@ 'use strict' | ||
/** | ||
* **Note:** Not sure if this will be kept or not but for now it's disabled. | ||
* | ||
* Sets a new position for this polygon and recalculates the points. | ||
* | ||
* @param {Vector} position A Vector representing the new position of this polygon. | ||
*/ | ||
// set position(position: Vector) { | ||
// const diffX: number = -(this._position.x - position.x); | ||
// const diffY: number = -(this._position.y - position.y); | ||
// const diffPoint: Vector = new Vector(diffX, diffY); | ||
// const points: Array<Vector> = []; | ||
// this._points.map((point: Vector) => { | ||
// const tempX: number = point.x; | ||
// const tempY: number = point.y; | ||
// const tempPoint: Vector = new Vector(tempX, tempY); | ||
// const calculatedPoint: Vector = tempPoint.add(diffPoint); | ||
// points.push(calculatedPoint); | ||
// }); | ||
// this.setPoints(points, true); | ||
// } | ||
/** | ||
* Returns the points of this polygon. | ||
@@ -149,3 +178,3 @@ * | ||
* @param {Array<Vector>} points An array of vectors representing the points in the polygon, in counter-clockwise order. | ||
* | ||
* * | ||
* @returns {Polygon} Returns this for chaining. | ||
@@ -152,0 +181,0 @@ */ |
@@ -194,3 +194,3 @@ 'use strict' | ||
circle.offset = c2d.vector(-10, -10); | ||
const collisionAfterOffsetChange = c2d.pointInCircle(c2d.vector(110, 110), circle); | ||
@@ -233,1 +233,209 @@ chai.expect(collisionAfterOffsetChange).to.be.false; | ||
}); | ||
describe('Collision - After moving from initial position', () => { | ||
it("testCircleCircle - should not detect a collision after a circle is moved from collision range", () => { | ||
const circle1 = c2d.circle(c2d.vector(0, 0), 20); | ||
const circle2 = c2d.circle(c2d.vector(10, 0), 20); | ||
// Test collision = true - without details. | ||
const collided = c2d.testCircleCircle(circle1, circle2); | ||
chai.expect(collided).to.be.true; | ||
circle2.translate(40, 50); | ||
// Test collision = false - moved from collision range. | ||
const collidedAfterMove = c2d.testCircleCircle(circle1, circle2); | ||
chai.expect(collidedAfterMove).to.be.false; | ||
}); | ||
it("testCircleCircle - should detect a collision after a circle is moved to collision range", () => { | ||
const circle1 = c2d.circle(c2d.vector(0, 0), 20); | ||
const circle2 = c2d.circle(c2d.vector(10, 100), 20); | ||
// Test collision = false. | ||
const collided = c2d.testCircleCircle(circle1, circle2); | ||
chai.expect(collided).to.be.false; | ||
circle2.translate(-5, -90); | ||
// Test collision = true - moved to collision range. | ||
const collidedAfterMove = c2d.testCircleCircle(circle1, circle2); | ||
chai.expect(collidedAfterMove).to.be.true; | ||
}); | ||
it("testPolygonCircle - should not detect a collision after the polygon is moved - (x, y) greater", () => { | ||
const circle = c2d.circle(c2d.vector(50, 50), 20); | ||
const polygon = c2d.polygon(c2d.vector(10, 10), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
// Test collision = true - no details | ||
const collided = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collided).to.be.true; | ||
polygon.translate(200, 300); | ||
// Test collision = false - after moving polygon to (200, 300); | ||
const collidedAfterMoving = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collidedAfterMoving).to.be.false; | ||
}); | ||
it("testPolygonCircle - should not detect a collision after the polygon is moved - (x, y) less", () => { | ||
const circle = c2d.circle(c2d.vector(50, 50), 20); | ||
const polygon = c2d.polygon(c2d.vector(10, 10), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
// Test collision = true - no details | ||
const collided = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collided).to.be.true; | ||
polygon.translate(-200, -150); | ||
// Test collision = false - after moving polygon to (-200, -150); | ||
const collidedAfterMoving = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collidedAfterMoving).to.be.false; | ||
}); | ||
it("testPolygonCircle - should detect a collision after the polygon is moved - (x, y) greater", () => { | ||
const circle = c2d.circle(c2d.vector(50, 50), 20); | ||
const polygon = c2d.polygon(c2d.vector(-150, -125), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
// Test collision = false | ||
const collided = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collided).to.be.false; | ||
polygon.translate(180, 150); | ||
// Test collision = true - after moving polygon to (30, 25); | ||
const collidedAfterMoving = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collidedAfterMoving).to.be.true; | ||
}); | ||
it("testPolygonCircle - should detect a collision after the polygon is moved - (x, y) less", () => { | ||
const circle = c2d.circle(c2d.vector(50, 50), 20); | ||
const polygon = c2d.polygon(c2d.vector(200, 300), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
// Test collision = false | ||
const collided = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collided).to.be.false; | ||
polygon.translate(-170, -275); | ||
// Test collision = true - after moving polygon to (30, 25); | ||
const collidedAfterMoving = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collidedAfterMoving).to.be.true; | ||
}); | ||
it("testPolygonCircle - should not detect a collision after the circle is moved", () => { | ||
const circle = c2d.circle(c2d.vector(50, 50), 20); | ||
const polygon = c2d.polygon(c2d.vector(25, 25), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
// Test collision = false | ||
const collided = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collided).to.be.true; | ||
circle.translate(200, 300); | ||
// Test collision = true - after moving polygon to (30, 25); | ||
const collidedAfterMoving = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collidedAfterMoving).to.be.false; | ||
}); | ||
it("testPolygonCircle - should detect a collision after the circle is moved", () => { | ||
const circle = c2d.circle(c2d.vector(200, 150), 20); | ||
const polygon = c2d.polygon(c2d.vector(0, 0), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
// Test collision = false | ||
const collided = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collided).to.be.false; | ||
circle.translate(-150, -100); | ||
// Test collision = true - after moving circle to (50, 50). | ||
const collidedAfterMoving = c2d.testPolygonCircle(polygon, circle); | ||
chai.expect(collidedAfterMoving).to.be.true; | ||
}); | ||
it("testPolygonPolygon - should not detect a collision after the polygon is moved - (x, y) greater", () => { | ||
const polygon1 = c2d.polygon(c2d.vector(0, 0), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
const polygon2 = c2d.polygon(c2d.vector(30, 0), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(30, 0), | ||
c2d.vector(0, 30) | ||
]); | ||
// Test collision = true. | ||
const collided = c2d.testPolygonPolygon(polygon1, polygon2); | ||
chai.expect(collided).to.be.true; | ||
// Test collision = false - after moving polygon. | ||
polygon2.translate(90, 150); | ||
const collidedAfterMoving = c2d.testPolygonPolygon(polygon1, polygon2); | ||
chai.expect(collidedAfterMoving).to.be.false; | ||
}); | ||
it("testPolygonPolygon - should not detect a collision after the polygon is moved - (x, y) less", () => { | ||
const polygon1 = c2d.polygon(c2d.vector(0, 0), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(40, 0), | ||
c2d.vector(40, 40), | ||
c2d.vector(0, 40) | ||
]); | ||
const polygon2 = c2d.polygon(c2d.vector(140, 150), [ | ||
c2d.vector(0, 0), | ||
c2d.vector(30, 0), | ||
c2d.vector(0, 30) | ||
]); | ||
// Test collision = false | ||
const collided = c2d.testPolygonPolygon(polygon1, polygon2); | ||
chai.expect(collided).to.be.false; | ||
// Test collision = true - after moving polygon. | ||
polygon2.translate(-110, -150); | ||
const collidedAfterMoving = c2d.testPolygonPolygon(polygon1, polygon2); | ||
chai.expect(collidedAfterMoving).to.be.true; | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
385125
6935