Skip to content

Commit 498e121

Browse files
committed
JSDoc blocks added.
1 parent b28962e commit 498e121

37 files changed

+427
-9
lines changed

v3/src/curves/curve/Curve.js

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,79 @@ var Curve = new Class({
99

1010
initialize:
1111

12+
/**
13+
* [description]
14+
*
15+
* @class Curve
16+
* @memberOf Phaser.Curves
17+
* @constructor
18+
* @since 3.0.0
19+
*
20+
* @param {string} type - [description]
21+
*/
1222
function Curve (type)
1323
{
14-
// String based identifier
24+
/**
25+
* String based identifier
26+
*
27+
* @property {string} type
28+
*/
1529
this.type = type;
1630

31+
/**
32+
* [description]
33+
*
34+
* @property {integer} defaultDivisions
35+
* @default 5
36+
*/
1737
this.defaultDivisions = 5;
1838

39+
/**
40+
* [description]
41+
*
42+
* @property {integer} arcLengthDivisions
43+
* @default 100
44+
*/
1945
this.arcLengthDivisions = 100;
2046

47+
/**
48+
* [description]
49+
*
50+
* @property {array} cacheArcLengths
51+
* @default []
52+
*/
2153
this.cacheArcLengths = [];
2254

55+
/**
56+
* [description]
57+
*
58+
* @property {boolean} needsUpdate
59+
* @default true
60+
*/
2361
this.needsUpdate = true;
2462

63+
/**
64+
* [description]
65+
*
66+
* @property {boolean} active
67+
* @default true
68+
*/
2569
this.active = true;
2670

71+
/**
72+
* [description]
73+
*
74+
* @property {Phaser.Math.Vector2} _tmpVec2A
75+
* @private
76+
*/
2777
this._tmpVec2A = new Vector2();
78+
79+
/**
80+
* [description]
81+
*
82+
* @property {Phaser.Math.Vector2} _tmpVec2B
83+
* @private
84+
*/
2885
this._tmpVec2B = new Vector2();
2986
},
3087

v3/src/curves/curve/inc/Draw.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* [description]
3+
*
4+
* @method Phaser.Curves.Curve#draw
5+
* @since 3.0.0
6+
*
7+
* @param {Phaser.GameObjects.Graphics} graphics - [description]
8+
* @param {integer} [pointsTotal=32] - [description]
9+
*
10+
* @return {Phaser.GameObjects.Graphics} [description]
11+
*/
112
var Draw = function (graphics, pointsTotal)
213
{
314
if (pointsTotal === undefined) { pointsTotal = 32; }

v3/src/curves/curve/inc/GetBounds.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
var FromPoints = require('../../../geom/rectangle/FromPoints');
22
var Rectangle = require('../../../geom/rectangle/Rectangle');
33

4+
/**
5+
* [description]
6+
*
7+
* @method Phaser.Curves.Curve#getBounds
8+
* @since 3.0.0
9+
*
10+
* @param {Phaser.Geom.Rectangle} out - [description]
11+
* @param {integer} [accuracy=16] - [description]
12+
*
13+
* @return {Phaser.Geom.Rectangle} [description]
14+
*/
415
var GetBounds = function (out, accuracy)
516
{
617
if (out === undefined) { out = new Rectangle(); }
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
// Return an array of points, spaced out X distance pixels apart
2+
3+
/**
4+
* [description]
5+
*
6+
* @method Phaser.Curves.Curve#getDistancePoints
7+
* @since 3.0.0
8+
*
9+
* @param {integer} distance - [description]
10+
*
11+
* @return {Phaser.Geom.Point[]} [description]
12+
*/
213
var GetDistancePoints = function (distance)
314
{
415
var len = this.getLength();
516

617
var spaced = Math.max(1, len / distance);
718

819
return this.getSpacedPoints(spaced);
9-
10-
// Get the t value for 200 pixels along the curve
11-
// var t = curve.getTFromDistance(200);
12-
// = this.getUtoTmapping(0, distance, divisions)
13-
14-
// Get the point at t
15-
// var p = curve.getPoint(t);
1620
};
1721

1822
module.exports = GetDistancePoints;

v3/src/curves/curve/inc/GetEndPoint.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
var Vector2 = require('../../../math/Vector2');
22

3+
/**
4+
* [description]
5+
*
6+
* @method Phaser.Curves.Curve#getEndPoint
7+
* @since 3.0.0
8+
*
9+
* @param {Phaser.Math.Vector2} out - [description]
10+
*
11+
* @return {Phaser.Math.Vector2} [description]
12+
*/
313
var GetEndPoint = function (out)
414
{
515
if (out === undefined) { out = new Vector2(); }

v3/src/curves/curve/inc/GetLength.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
// Get total curve arc length
22

3+
/**
4+
* [description]
5+
*
6+
* @method Phaser.Curves.Curve#getLength
7+
* @since 3.0.0
8+
*
9+
* @return {number} [description]
10+
*/
311
var GetLength = function ()
412
{
513
var lengths = this.getLengths();

v3/src/curves/curve/inc/GetLengths.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// Get list of cumulative segment lengths
22

3+
/**
4+
* [description]
5+
*
6+
* @method Phaser.Curves.Curve#getLengths
7+
* @since 3.0.0
8+
*
9+
* @param {integer} [divisions] - [description]
10+
*
11+
* @return {number[]} [description]
12+
*/
313
var GetLengths = function (divisions)
414
{
515
if (divisions === undefined) { divisions = this.arcLengthDivisions; }

v3/src/curves/curve/inc/GetPointAt.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
// - u [0 .. 1]
44

5+
/**
6+
* [description]
7+
*
8+
* @method Phaser.Curves.Curve#getPointAt
9+
* @since 3.0.0
10+
*
11+
* @param {float} u - [description]
12+
* @param {Phaser.Math.Vector2} [out] - [description]
13+
*
14+
* @return {Phaser.Math.Vector2} [description]
15+
*/
516
var GetPointAt = function (u, out)
617
{
718
var t = this.getUtoTmapping(u);

v3/src/curves/curve/inc/GetPoints.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// Get sequence of points using getPoint( t )
22

3+
/**
4+
* [description]
5+
*
6+
* @method Phaser.Curves.Curve#getPoints
7+
* @since 3.0.0
8+
*
9+
* @param {integer} [divisions] - [description]
10+
*
11+
* @return {Phaser.Math.Vector2[]} [description]
12+
*/
313
var GetPoints = function (divisions)
414
{
515
if (divisions === undefined) { divisions = this.defaultDivisions; }

v3/src/curves/curve/inc/GetSpacedPoints.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// Get sequence of points using getPointAt( u )
22

3+
/**
4+
* [description]
5+
*
6+
* @method Phaser.Curves.Curve#getSpacedPoints
7+
* @since 3.0.0
8+
*
9+
* @param {integer} [divisions] - [description]
10+
*
11+
* @return {Phaser.Math.Vector2[]} [description]
12+
*/
313
var GetSpacedPoints = function (divisions)
414
{
515
if (divisions === undefined) { divisions = this.defaultDivisions; }

0 commit comments

Comments
 (0)