Fix multiple types on Geom

This commit is contained in:
orblazer 2018-03-20 16:01:08 +01:00
parent 37b6fc5862
commit 8a9223811f
34 changed files with 76 additions and 76 deletions

View file

@ -103,9 +103,9 @@ var Circle = new Class({
* @since 3.0.0
*
* @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.
* @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created.
* @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.
*
* @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the circle.
* @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle.
*/
getPoint: function (position, point)
{
@ -136,9 +136,9 @@ var Circle = new Class({
* @method Phaser.Geom.Circle#getRandomPoint
* @since 3.0.0
*
* @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in.
* @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.
*
* @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties.
* @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.
*/
getRandomPoint: function (point)
{
@ -220,7 +220,7 @@ var Circle = new Class({
/**
* The radius of the Circle.
*
*
* @name Phaser.Geom.Circle#radius
* @type {number}
* @since 3.0.0
@ -242,7 +242,7 @@ var Circle = new Class({
/**
* The diameter of the Circle.
*
*
* @name Phaser.Geom.Circle#diameter
* @type {number}
* @since 3.0.0
@ -264,7 +264,7 @@ var Circle = new Class({
/**
* The left position of the Circle.
*
*
* @name Phaser.Geom.Circle#left
* @type {number}
* @since 3.0.0
@ -285,7 +285,7 @@ var Circle = new Class({
/**
* The right position of the Circle.
*
*
* @name Phaser.Geom.Circle#right
* @type {number}
* @since 3.0.0
@ -306,7 +306,7 @@ var Circle = new Class({
/**
* The top position of the Circle.
*
*
* @name Phaser.Geom.Circle#top
* @type {number}
* @since 3.0.0
@ -327,7 +327,7 @@ var Circle = new Class({
/**
* The bottom position of the Circle.
*
*
* @name Phaser.Geom.Circle#bottom
* @type {number}
* @since 3.0.0

View file

@ -14,9 +14,9 @@ var Point = require('../point/Point');
*
* @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on.
* @param {number} angle - The angle from the center of the Circle to the circumference to return the point from. Given in radians.
* @param {Phaser.Geom.Point|object} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.
* @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.
*
* @return {Phaser.Geom.Point|object} A Point object where the `x` and `y` properties are the point on the circumference.
* @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference.
*/
var CircumferencePoint = function (circle, angle, out)
{

View file

@ -12,7 +12,7 @@ var Circle = require('./Circle');
* @function Phaser.Geom.Circle.Clone
* @since 3.0.0
*
* @param {Phaser.Geom.Circle|object} source - The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties.
* @param {(Phaser.Geom.Circle|object)} source - The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties.
*
* @return {Phaser.Geom.Circle} A clone of the source Circle.
*/

View file

@ -13,7 +13,7 @@ var Contains = require('./Contains');
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circle - The Circle to check.
* @param {Phaser.Geom.Point|object} point - The Point object to check if it's within the Circle or not.
* @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not.
*
* @return {boolean} True if the Point coordinates are within the circle, otherwise false.
*/

View file

@ -13,7 +13,7 @@ var Contains = require('./Contains');
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circle - The Circle to check.
* @param {Phaser.Geom.Rectangle|object} rect - The Rectangle object to check if it's within the Circle or not.
* @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Circle or not.
*
* @return {boolean} True if all of the Rectangle coordinates are within the circle, otherwise false.
*/

View file

@ -13,9 +13,9 @@ var Rectangle = require('../rectangle/Rectangle');
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circle - The Circle to get the bounds from.
* @param {Phaser.Geom.Rectangle|object} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created.
* @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created.
*
* @return {Phaser.Geom.Rectangle|object} The Rectangle object containing the Circles bounds.
* @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Circles bounds.
*/
var GetBounds = function (circle, out)
{

View file

@ -19,9 +19,9 @@ var Point = require('../point/Point');
*
* @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on.
* @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.
* @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created.
* @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.
*
* @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the circle.
* @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle.
*/
var GetPoint = function (circle, position, out)
{

View file

@ -11,7 +11,7 @@
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.)
* @param {Phaser.Geom.Point|object} point - The Point object containing the values to offset the Circle by.
* @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Circle by.
*
* @return {Phaser.Geom.Circle} The Circle that was offset.
*/

View file

@ -13,9 +13,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circle - The Circle to get a random point from.
* @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in.
* @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.
*
* @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties.
* @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.
*/
var Random = function (circle, out)
{

View file

@ -14,9 +14,9 @@ var Point = require('../point/Point');
*
* @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on.
* @param {number} angle - The angle from the center of the Ellipse to the circumference to return the point from. Given in radians.
* @param {Phaser.Geom.Point|object} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.
* @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.
*
* @return {Phaser.Geom.Point|object} A Point object where the `x` and `y` properties are the point on the circumference.
* @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference.
*/
var CircumferencePoint = function (ellipse, angle, out)
{

View file

@ -13,7 +13,7 @@ var Contains = require('./Contains');
* @since 3.0.0
*
* @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check.
* @param {Phaser.Geom.Point|object} point - The Point object to check if it's within the Circle or not.
* @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not.
*
* @return {boolean} True if the Point coordinates are within the circle, otherwise false.
*/

View file

@ -13,7 +13,7 @@ var Contains = require('./Contains');
* @since 3.0.0
*
* @param {Phaser.Geom.Ellipse} ellipse - [description]
* @param {Phaser.Geom.Rectangle|object} rect - The Rectangle object to check if it's within the Ellipse or not.
* @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Ellipse or not.
*
* @return {boolean} True if all of the Rectangle coordinates are within the ellipse, otherwise false.
*/

View file

@ -105,9 +105,9 @@ var Ellipse = new Class({
* @since 3.0.0
*
* @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse.
* @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created.
* @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.
*
* @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the ellipse.
* @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse.
*/
getPoint: function (position, point)
{
@ -138,9 +138,9 @@ var Ellipse = new Class({
* @method Phaser.Geom.Ellipse#getRandomPoint
* @since 3.0.0
*
* @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in.
* @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.
*
* @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties.
* @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.
*/
getRandomPoint: function (point)
{

View file

@ -13,9 +13,9 @@ var Rectangle = require('../rectangle/Rectangle');
* @since 3.0.0
*
* @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the bounds from.
* @param {Phaser.Geom.Rectangle|object} [out] - A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created.
* @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created.
*
* @return {Phaser.Geom.Rectangle|object} The Rectangle object containing the Ellipse bounds.
* @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Ellipse bounds.
*/
var GetBounds = function (ellipse, out)
{

View file

@ -19,9 +19,9 @@ var Point = require('../point/Point');
*
* @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on.
* @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse.
* @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created.
* @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.
*
* @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the ellipse.
* @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse.
*/
var GetPoint = function (ellipse, position, out)
{

View file

@ -11,7 +11,7 @@
* @since 3.0.0
*
* @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to be offset (translated.)
* @param {Phaser.Geom.Point|object} point - The Point object containing the values to offset the Ellipse by.
* @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Ellipse by.
*
* @return {Phaser.Geom.Ellipse} The Ellipse that was offset.
*/

View file

@ -13,9 +13,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get a random point from.
* @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in.
* @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.
*
* @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties.
* @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.
*/
var Random = function (ellipse, out)
{

View file

@ -19,7 +19,7 @@
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - [description]
* @param {Phaser.Geom.Rectangle|object} rect - [description]
* @param {(Phaser.Geom.Rectangle|object)} rect - [description]
*
* @return {boolean} [description]
*/

View file

@ -13,9 +13,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var GetMidPoint = function (line, out)
{

View file

@ -15,9 +15,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var GetNormal = function (line, out)
{

View file

@ -17,9 +17,9 @@ var Point = require('../point/Point');
*
* @param {Phaser.Geom.Line} line - [description]
* @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var GetPoint = function (line, position, out)
{

View file

@ -79,9 +79,9 @@ var Line = new Class({
* @since 3.0.0
*
* @param {float} position - [description]
* @param {Phaser.Geom.Point|object} [output] - [description]
* @param {(Phaser.Geom.Point|object)} [output] - [description]
*
* @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the ellipse.
* @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse.
*/
getPoint: function (position, output)
{
@ -96,9 +96,9 @@ var Line = new Class({
*
* @param {integer} quantity - [description]
* @param {integer} [stepRate] - [description]
* @param {array|Phaser.Geom.Point[]} [output] - [description]
* @param {(array|Phaser.Geom.Point[])} [output] - [description]
*
* @return {array|Phaser.Geom.Point[]} [description]
* @return {(array|Phaser.Geom.Point[])} [description]
*/
getPoints: function (quantity, stepRate, output)
{
@ -111,7 +111,7 @@ var Line = new Class({
* @method Phaser.Geom.Line#getRandomPoint
* @since 3.0.0
*
* @param {Phaser.Geom.Point|object} point - [description]
* @param {(Phaser.Geom.Point|object)} point - [description]
*
* @return {Phaser.Geom.Point} [description]
*/

View file

@ -13,9 +13,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var Random = function (line, out)
{

View file

@ -13,7 +13,7 @@ var RotateAroundXY = require('./RotateAroundXY');
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - [description]
* @param {Phaser.Geom.Point|object} point - [description]
* @param {(Phaser.Geom.Point|object)} point - [description]
* @param {number} angle - [description]
*
* @return {Phaser.Geom.Line} [description]

View file

@ -15,9 +15,9 @@ var Point = require('./Point');
* @param {Phaser.Geom.Point} pointA - [description]
* @param {Phaser.Geom.Point} pointB - [description]
* @param {float} [t=0] - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var Interpolate = function (pointA, pointB, t, out)
{

View file

@ -13,9 +13,9 @@ var Rectangle = require('../rectangle/Rectangle');
* @since 3.0.0
*
* @param {Phaser.Geom.Polygon} polygon - [description]
* @param {Phaser.Geom.Rectangle|object} [out] - [description]
* @param {(Phaser.Geom.Rectangle|object)} [out] - [description]
*
* @return {Phaser.Geom.Rectangle|object} [description]
* @return {(Phaser.Geom.Rectangle|object)} [description]
*/
var GetAABB = function (polygon, out)
{

View file

@ -15,9 +15,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Rectangle} rect - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var GetCenter = function (rect, out)
{

View file

@ -15,7 +15,7 @@ var Point = require('../point/Point');
*
* @param {Phaser.Geom.Rectangle} rectangle - [description]
* @param {float} position - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point} [description]
*/

View file

@ -6,7 +6,7 @@
var Point = require('../point/Point');
// The size of the Rectangle object, expressed as a Point object
// The size of the Rectangle object, expressed as a Point object
// with the values of the width and height properties.
/**
@ -16,9 +16,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Rectangle} rect - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var GetSize = function (rect, out)
{

View file

@ -100,9 +100,9 @@ var Rectangle = new Class({
* @since 3.0.0
*
* @param {float} position - [description]
* @param {Phaser.Geom.Point|object} output - [description]
* @param {(Phaser.Geom.Point|object)} output - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
getPoint: function (position, output)
{
@ -117,9 +117,9 @@ var Rectangle = new Class({
*
* @param {integer} quantity - [description]
* @param {number} [stepRate] - [description]
* @param {array|Phaser.Geom.Point[]} [output] - [description]
* @param {(array|Phaser.Geom.Point[])} [output] - [description]
*
* @return {array|Phaser.Geom.Point[]} [description]
* @return {(array|Phaser.Geom.Point[])} [description]
*/
getPoints: function (quantity, stepRate, output)
{

View file

@ -17,9 +17,9 @@ var Point = require('../point/Point');
* @since 3.0.0
*
* @param {Phaser.Geom.Triangle} triangle - [description]
* @param {Phaser.Geom.Point|object} [out] - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var Centroid = function (triangle, out)
{

View file

@ -16,9 +16,9 @@ var Length = require('../line/Length');
*
* @param {Phaser.Geom.Triangle} triangle - [description]
* @param {float} position - [description]
* @param {Phaser.Geom.Point|object} out - [description]
* @param {(Phaser.Geom.Point|object)} out - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
var GetPoint = function (triangle, position, out)
{

View file

@ -16,9 +16,9 @@ var Point = require('../point/Point');
* @param {Phaser.Geom.Triangle} triangle - [description]
* @param {integer} quantity - [description]
* @param {number} stepRate - [description]
* @param {array|Phaser.Geom.Point[]} out - [description]
* @param {(array|Phaser.Geom.Point[])} out - [description]
*
* @return {array|Phaser.Geom.Point[]} [description]
* @return {(array|Phaser.Geom.Point[])} [description]
*/
var GetPoints = function (triangle, quantity, stepRate, out)
{

View file

@ -126,9 +126,9 @@ var Triangle = new Class({
* @since 3.0.0
*
* @param {float} position - [description]
* @param {Phaser.Geom.Point|object} output - [description]
* @param {(Phaser.Geom.Point|object)} output - [description]
*
* @return {Phaser.Geom.Point|object} [description]
* @return {(Phaser.Geom.Point|object)} [description]
*/
getPoint: function (position, output)
{
@ -143,9 +143,9 @@ var Triangle = new Class({
*
* @param {integer} quantity - [description]
* @param {number} [stepRate] - [description]
* @param {array|Phaser.Geom.Point[]} [output] - [description]
* @param {(array|Phaser.Geom.Point[])} [output] - [description]
*
* @return {array|Phaser.Geom.Point[]} [description]
* @return {(array|Phaser.Geom.Point[])} [description]
*/
getPoints: function (quantity, stepRate, output)
{