Skip to content

Commit db780c3

Browse files
committed
update Matter.Body docs
1 parent 70600a8 commit db780c3

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

src/body/Body.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ var Axes = require('../geometry/Axes');
458458
};
459459

460460
/**
461-
* Sets the position of the body instantly. By default velocity, angle, force etc. are unchanged.
461+
* Sets the position of the body. By default velocity is unchanged.
462462
* If `updateVelocity` is `true` then velocity is inferred from the change in position.
463463
* @method setPosition
464464
* @param {body} body
@@ -489,7 +489,7 @@ var Axes = require('../geometry/Axes');
489489
};
490490

491491
/**
492-
* Sets the angle of the body instantly. By default angular velocity, position, force etc. are unchanged.
492+
* Sets the angle of the body. By default angular velocity is unchanged.
493493
* If `updateVelocity` is `true` then angular velocity is inferred from the change in angle.
494494
* @method setAngle
495495
* @param {body} body
@@ -520,7 +520,8 @@ var Axes = require('../geometry/Axes');
520520
};
521521

522522
/**
523-
* Sets the linear velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`.
523+
* Sets the current linear velocity of the body. Updates `body.speed`. See `body.velocity` for details.
524+
* Use this instead of setting `body.velocity`. See also `Body.applyForce`.
524525
* @method setVelocity
525526
* @param {body} body
526527
* @param {vector} velocity
@@ -535,7 +536,7 @@ var Axes = require('../geometry/Axes');
535536
};
536537

537538
/**
538-
* Gets the linear velocity of the body. Use this instead of the internal `body.velocity`.
539+
* Gets the current linear velocity of the body. See `body.velocity` for details.
539540
* @method getVelocity
540541
* @param {body} body
541542
* @return {vector} velocity
@@ -550,7 +551,7 @@ var Axes = require('../geometry/Axes');
550551
};
551552

552553
/**
553-
* Gets the linear speed the body. Use this instead of the internal `body.speed`.
554+
* Gets the current linear speed of the body. See `body.speed` for details.
554555
* @method getSpeed
555556
* @param {body} body
556557
* @return {number} speed
@@ -560,7 +561,7 @@ var Axes = require('../geometry/Axes');
560561
};
561562

562563
/**
563-
* Sets the linear speed of the body. Use this instead of the internal `body.speed`.
564+
* Sets the current linear speed of the body. See `body.speed` for details. Use this instead of setting `body.speed`.
564565
* @method setSpeed
565566
* @param {body} body
566567
* @param {number} speed
@@ -570,7 +571,8 @@ var Axes = require('../geometry/Axes');
570571
};
571572

572573
/**
573-
* Sets the angular velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`.
574+
* Sets the current rotational velocity of the body. Updates `body.angularSpeed`. See `body.angularVelocity` for details.
575+
* Use this instead of setting `body.angularVelocity`. See also `Body.applyForce`.
574576
* @method setAngularVelocity
575577
* @param {body} body
576578
* @param {number} velocity
@@ -583,7 +585,7 @@ var Axes = require('../geometry/Axes');
583585
};
584586

585587
/**
586-
* Gets the angular velocity of the body. Use this instead of the internal `body.angularVelocity`.
588+
* Gets the current rotational velocity of the body. See `body.angularVelocity` for details.
587589
* @method getAngularVelocity
588590
* @param {body} body
589591
* @return {number} angular velocity
@@ -593,7 +595,7 @@ var Axes = require('../geometry/Axes');
593595
};
594596

595597
/**
596-
* Gets the angular speed of the body. Use this instead of the internal `body.angularSpeed`.
598+
* Gets the current rotational speed of the body. See `body.angularSpeed` for details.
597599
* @method getAngularSpeed
598600
* @param {body} body
599601
* @return {number} angular speed
@@ -603,7 +605,7 @@ var Axes = require('../geometry/Axes');
603605
};
604606

605607
/**
606-
* Sets the angular speed of the body. Use this instead of the internal `body.angularSpeed`.
608+
* Sets the current rotational speed of the body. See `body.angularSpeed` for details. Use this instead of setting `body.angularSpeed`.
607609
* @method setAngularSpeed
608610
* @param {body} body
609611
* @param {number} speed
@@ -613,7 +615,7 @@ var Axes = require('../geometry/Axes');
613615
};
614616

615617
/**
616-
* Moves a body by a given vector relative to its current position, without imparting any velocity by default.
618+
* Moves a body by a given vector relative to its current position. By default velocity is unchanged.
617619
* If `updateVelocity` is `true` then velocity is inferred from the change in position.
618620
* @method translate
619621
* @param {body} body
@@ -625,7 +627,7 @@ var Axes = require('../geometry/Axes');
625627
};
626628

627629
/**
628-
* Rotates a body by a given angle relative to its current angle, without imparting any angular velocity by default.
630+
* Rotates a body by a given angle relative to its current angle. By default angular velocity is unchanged.
629631
* If `updateVelocity` is `true` then angular velocity is inferred from the change in angle.
630632
* @method rotate
631633
* @param {body} body
@@ -971,7 +973,7 @@ var Axes = require('../geometry/Axes');
971973

972974
/**
973975
* Internal only. Use `Body.getSpeed` and `Body.setSpeed` instead.
974-
*
976+
*
975977
* @readOnly
976978
* @property speed
977979
* @type number
@@ -980,7 +982,7 @@ var Axes = require('../geometry/Axes');
980982

981983
/**
982984
* Internal only. Use `Body.getAngularSpeed` and `Body.setAngularSpeed` instead.
983-
*
985+
*
984986
* @readOnly
985987
* @property angularSpeed
986988
* @type number

0 commit comments

Comments
 (0)