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:
parent
f4f3bf7c48
commit
b327a40e9b
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue