Skip to content

Commit 1f72b90

Browse files
committed
Added jsdocs
1 parent 12b59ea commit 1f72b90

7 files changed

Lines changed: 586 additions & 8 deletions

File tree

src/curves/cubicbezier/CubicBezierCurve.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ var CubicBezierCurve = new Class({
1717
// p1 = control point 1
1818
// p2 = control point 2
1919
// p3 = end point
20+
/**
21+
* [description]
22+
*
23+
* @class CubicBezierCurve
24+
* @extends Phaser.Curves.Curve
25+
* @memberOf Phaser.Curves
26+
* @constructor
27+
* @since 3.0.0
28+
*
29+
* @param {[type]} p0 - [description]
30+
* @param {[type]} p1 - [description]
31+
* @param {[type]} p2 - [description]
32+
* @param {[type]} p3 - [description]
33+
*/
2034
function CubicBezierCurve (p0, p1, p2, p3)
2135
{
2236
Curve.call(this, 'CubicBezierCurve');
@@ -29,24 +43,82 @@ var CubicBezierCurve = new Class({
2943
p0 = new Vector2(p0[0], p0[1]);
3044
}
3145

46+
/**
47+
* [description]
48+
*
49+
* @property {[type]} p0
50+
* @since 3.0.0
51+
*/
3252
this.p0 = p0;
53+
54+
/**
55+
* [description]
56+
*
57+
* @property {[type]} p1
58+
* @since 3.0.0
59+
*/
3360
this.p1 = p1;
61+
62+
/**
63+
* [description]
64+
*
65+
* @property {[type]} p2
66+
* @since 3.0.0
67+
*/
3468
this.p2 = p2;
69+
70+
/**
71+
* [description]
72+
*
73+
* @property {[type]} p3
74+
* @since 3.0.0
75+
*/
3576
this.p3 = p3;
3677
},
3778

79+
/**
80+
* [description]
81+
*
82+
* @method Phaser.Curves.CubicBezierCurve#getStartPoint
83+
* @since 3.0.0
84+
*
85+
* @param {[type]} out - [description]
86+
*
87+
* @return {[type]} [description]
88+
*/
3889
getStartPoint: function (out)
3990
{
4091
if (out === undefined) { out = new Vector2(); }
4192

4293
return out.copy(this.p0);
4394
},
4495

96+
/**
97+
* [description]
98+
*
99+
* @method Phaser.Curves.CubicBezierCurve#getResolution
100+
* @since 3.0.0
101+
*
102+
* @param {[type]} divisions - [description]
103+
*
104+
* @return {[type]} [description]
105+
*/
45106
getResolution: function (divisions)
46107
{
47108
return divisions;
48109
},
49110

111+
/**
112+
* [description]
113+
*
114+
* @method Phaser.Curves.CubicBezierCurve#getPoint
115+
* @since 3.0.0
116+
*
117+
* @param {[type]} t - [description]
118+
* @param {[type]} out - [description]
119+
*
120+
* @return {[type]} [description]
121+
*/
50122
getPoint: function (t, out)
51123
{
52124
if (out === undefined) { out = new Vector2(); }
@@ -59,6 +131,17 @@ var CubicBezierCurve = new Class({
59131
return out.set(CubicBezier(t, p0.x, p1.x, p2.x, p3.x), CubicBezier(t, p0.y, p1.y, p2.y, p3.y));
60132
},
61133

134+
/**
135+
* [description]
136+
*
137+
* @method Phaser.Curves.CubicBezierCurve#draw
138+
* @since 3.0.0
139+
*
140+
* @param {[type]} graphics - [description]
141+
* @param {[type]} pointsTotal - [description]
142+
*
143+
* @return {[type]} [description]
144+
*/
62145
draw: function (graphics, pointsTotal)
63146
{
64147
if (pointsTotal === undefined) { pointsTotal = 32; }
@@ -79,6 +162,14 @@ var CubicBezierCurve = new Class({
79162
return graphics;
80163
},
81164

165+
/**
166+
* [description]
167+
*
168+
* @method Phaser.Curves.CubicBezierCurve#toJSON
169+
* @since 3.0.0
170+
*
171+
* @return {[type]} [description]
172+
*/
82173
toJSON: function ()
83174
{
84175
return {

src/curves/curve/Curve.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,62 +33,62 @@ var Curve = new Class({
3333
* The default number of divisions within the curve.
3434
*
3535
* @property {integer} defaultDivisions
36-
* @since 3.0.0
3736
* @default 5
37+
* @since 3.0.0
3838
*/
3939
this.defaultDivisions = 5;
4040

4141
/**
4242
* The quantity of arc length divisions within the curve.
4343
*
4444
* @property {integer} arcLengthDivisions
45-
* @since 3.0.0
4645
* @default 100
46+
* @since 3.0.0
4747
*/
4848
this.arcLengthDivisions = 100;
4949

5050
/**
5151
* An array of cached arc length values.
5252
*
5353
* @property {array} cacheArcLengths
54-
* @since 3.0.0
5554
* @default []
55+
* @since 3.0.0
5656
*/
5757
this.cacheArcLengths = [];
5858

5959
/**
6060
* Does the data of this curve need updating?
6161
*
6262
* @property {boolean} needsUpdate
63-
* @since 3.0.0
6463
* @default true
64+
* @since 3.0.0
6565
*/
6666
this.needsUpdate = true;
6767

6868
/**
6969
* [description]
7070
*
7171
* @property {boolean} active
72-
* @since 3.0.0
7372
* @default true
73+
* @since 3.0.0
7474
*/
7575
this.active = true;
7676

7777
/**
7878
* A temporary calculation Vector.
7979
*
8080
* @property {Phaser.Math.Vector2} _tmpVec2A
81-
* @since 3.0.0
8281
* @private
82+
* @since 3.0.0
8383
*/
8484
this._tmpVec2A = new Vector2();
8585

8686
/**
8787
* A temporary calculation Vector.
8888
*
8989
* @property {Phaser.Math.Vector2} _tmpVec2B
90-
* @since 3.0.0
9190
* @private
91+
* @since 3.0.0
9292
*/
9393
this._tmpVec2B = new Vector2();
9494
},

0 commit comments

Comments
 (0)