0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

added Vector.create

This commit is contained in:
liabru 2015-01-24 19:40:23 +00:00
parent f4f3bf7c48
commit b327a40e9b

View file

@ -15,6 +15,17 @@ var Vector = {};
(function() {
/**
* Creates a new vector.
* @method create
* @param {number} x
* @param {number} y
* @return {vector} A new vector
*/
Vector.create = function(x, y) {
return { x: x || 0, y: y || 0 };
};
/**
* Returns a new vector with `x` and `y` copied from the given `vector`.
* @method clone