You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {number} u - The relative position, [0..1].
287
+
* @param {Phaser.Math.Vector2} [out] - A point to store the result in.
280
288
*
281
-
* @return {Phaser.Math.Vector2} [description]
289
+
* @return {Phaser.Math.Vector2} The point.
282
290
*/
283
291
getPointAt: function(u,out)
284
292
{
@@ -290,13 +298,23 @@ var Curve = new Class({
290
298
// Get sequence of points using getPoint( t )
291
299
292
300
/**
293
-
* [description]
301
+
* Get a sequence of evenly spaced points from the curve.
302
+
*
303
+
* You can pass `divisions`, `stepRate`, or neither.
304
+
*
305
+
* The number of divisions will be
306
+
*
307
+
* 1. `divisions`, if `divisions` > 0; or
308
+
* 2. `this.getLength / stepRate`, if `stepRate` > 0; or
309
+
* 3. `this.defaultDivisions`
310
+
*
311
+
* `1 + divisions` points will be returned.
294
312
*
295
313
* @method Phaser.Curves.Curve#getPoints
296
314
* @since 3.0.0
297
315
*
298
-
* @param {integer} divisions - The number of evenly spaced points from the curve to return. If falsy, step param will be used to calculate the number of points.
299
-
* @param {number} step - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive.
316
+
* @param {integer} [divisions] - The number of divisions to make.
317
+
* @param {number} [stepRate] - The curve distance between points, implying `divisions`.
300
318
* @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in.
301
319
*
302
320
* @return {(array|Phaser.Math.Vector2[])} An array of Points from the curve.
@@ -327,16 +345,16 @@ var Curve = new Class({
327
345
},
328
346
329
347
/**
330
-
* [description]
348
+
* Get a random point from the curve.
331
349
*
332
350
* @method Phaser.Curves.Curve#getRandomPoint
333
351
* @since 3.0.0
334
352
*
335
353
* @generic {Phaser.Math.Vector2} O - [out,$return]
* @param {Phaser.Math.Vector2} [out] - A point object to store the result in.
338
356
*
339
-
* @return {Phaser.Math.Vector2} [description]
357
+
* @return {Phaser.Math.Vector2} The point.
340
358
*/
341
359
getRandomPoint: function(out)
342
360
{
@@ -348,16 +366,18 @@ var Curve = new Class({
348
366
// Get sequence of points using getPointAt( u )
349
367
350
368
/**
351
-
* [description]
369
+
* Get a sequence of equally spaced points (by arc distance) from the curve.
370
+
*
371
+
* `1 + divisions` points will be returned.
352
372
*
353
373
* @method Phaser.Curves.Curve#getSpacedPoints
354
374
* @since 3.0.0
355
375
*
356
-
* @param {integer} [divisions] - The number of evenly spaced points from the curve to return. If falsy, step param will be used to calculate the number of points.
357
-
* @param {number} [step] - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive.
376
+
* @param {integer} [divisions=this.defaultDivisions] - The number of divisions to make.
377
+
* @param {number} [stepRate] - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive.
358
378
* @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in.
359
379
*
360
-
* @return {Phaser.Math.Vector2[]} [description]
380
+
* @return {Phaser.Math.Vector2[]} An array of points.
361
381
*/
362
382
getSpacedPoints: function(divisions,stepRate,out)
363
383
{
@@ -387,16 +407,16 @@ var Curve = new Class({
387
407
},
388
408
389
409
/**
390
-
* [description]
410
+
* Get a point at the start of the curve.
391
411
*
392
412
* @method Phaser.Curves.Curve#getStartPoint
393
413
* @since 3.0.0
394
414
*
395
415
* @generic {Phaser.Math.Vector2} O - [out,$return]
Copy file name to clipboardExpand all lines: src/curves/path/Path.js
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -569,14 +569,12 @@ var Path = new Class({
569
569
},
570
570
571
571
/**
572
-
* Returns the defined starting point of the Path.
573
-
*
574
-
* This is not necessarily equal to the starting point of the first Curve if it differs from {@link startPoint}.
572
+
* Get a sequence of points on the path.
575
573
*
576
574
* @method Phaser.Curves.Path#getPoints
577
575
* @since 3.0.0
578
576
*
579
-
* @param {integer} [divisions=12] - The number of points to divide the path in to.
577
+
* @param {integer} [divisions=12] - The number of divisions per resolution per curve.
580
578
*
581
579
* @return {Phaser.Math.Vector2[]} An array of Vector2 objects that containing the points along the Path.
582
580
*/
@@ -626,7 +624,7 @@ var Path = new Class({
626
624
627
625
/**
628
626
* Returns a randomly chosen point anywhere on the path. This follows the same rules as `getPoint` in that it may return a point on any Curve inside this path.
629
-
*
627
+
*
630
628
* When calling this method multiple times, the points are not guaranteed to be equally spaced spatially.
631
629
*
632
630
* @method Phaser.Curves.Path#getRandomPoint
@@ -647,7 +645,7 @@ var Path = new Class({
647
645
648
646
/**
649
647
* Divides this Path into a set of equally spaced points,
650
-
*
648
+
*
651
649
* The resulting points are equally spaced with respect to the points' position on the path, but not necessarily equally spaced spatially.
652
650
*
653
651
* @method Phaser.Curves.Path#getSpacedPoints
@@ -741,7 +739,7 @@ var Path = new Class({
741
739
742
740
/**
743
741
* Creates a "gap" in this path from the path's current end point to the given coordinates.
744
-
*
742
+
*
745
743
* After calling this function, this Path's end point will be equal to the given coordinates
0 commit comments