0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-26 13:49:01 -05:00

update Matter.Body docs

This commit is contained in:
liabru 2022-01-04 11:03:08 +00:00
parent 70600a8c11
commit db780c371c

View file

@ -458,7 +458,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Sets the position of the body instantly. By default velocity, angle, force etc. are unchanged. * Sets the position of the body. By default velocity is unchanged.
* If `updateVelocity` is `true` then velocity is inferred from the change in position. * If `updateVelocity` is `true` then velocity is inferred from the change in position.
* @method setPosition * @method setPosition
* @param {body} body * @param {body} body
@ -489,7 +489,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Sets the angle of the body instantly. By default angular velocity, position, force etc. are unchanged. * Sets the angle of the body. By default angular velocity is unchanged.
* If `updateVelocity` is `true` then angular velocity is inferred from the change in angle. * If `updateVelocity` is `true` then angular velocity is inferred from the change in angle.
* @method setAngle * @method setAngle
* @param {body} body * @param {body} body
@ -520,7 +520,8 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Sets the linear velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`. * Sets the current linear velocity of the body. Updates `body.speed`. See `body.velocity` for details.
* Use this instead of setting `body.velocity`. See also `Body.applyForce`.
* @method setVelocity * @method setVelocity
* @param {body} body * @param {body} body
* @param {vector} velocity * @param {vector} velocity
@ -535,7 +536,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Gets the linear velocity of the body. Use this instead of the internal `body.velocity`. * Gets the current linear velocity of the body. See `body.velocity` for details.
* @method getVelocity * @method getVelocity
* @param {body} body * @param {body} body
* @return {vector} velocity * @return {vector} velocity
@ -550,7 +551,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Gets the linear speed the body. Use this instead of the internal `body.speed`. * Gets the current linear speed of the body. See `body.speed` for details.
* @method getSpeed * @method getSpeed
* @param {body} body * @param {body} body
* @return {number} speed * @return {number} speed
@ -560,7 +561,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Sets the linear speed of the body. Use this instead of the internal `body.speed`. * Sets the current linear speed of the body. See `body.speed` for details. Use this instead of setting `body.speed`.
* @method setSpeed * @method setSpeed
* @param {body} body * @param {body} body
* @param {number} speed * @param {number} speed
@ -570,7 +571,8 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Sets the angular velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`. * Sets the current rotational velocity of the body. Updates `body.angularSpeed`. See `body.angularVelocity` for details.
* Use this instead of setting `body.angularVelocity`. See also `Body.applyForce`.
* @method setAngularVelocity * @method setAngularVelocity
* @param {body} body * @param {body} body
* @param {number} velocity * @param {number} velocity
@ -583,7 +585,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Gets the angular velocity of the body. Use this instead of the internal `body.angularVelocity`. * Gets the current rotational velocity of the body. See `body.angularVelocity` for details.
* @method getAngularVelocity * @method getAngularVelocity
* @param {body} body * @param {body} body
* @return {number} angular velocity * @return {number} angular velocity
@ -593,7 +595,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Gets the angular speed of the body. Use this instead of the internal `body.angularSpeed`. * Gets the current rotational speed of the body. See `body.angularSpeed` for details.
* @method getAngularSpeed * @method getAngularSpeed
* @param {body} body * @param {body} body
* @return {number} angular speed * @return {number} angular speed
@ -603,7 +605,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Sets the angular speed of the body. Use this instead of the internal `body.angularSpeed`. * Sets the current rotational speed of the body. See `body.angularSpeed` for details. Use this instead of setting `body.angularSpeed`.
* @method setAngularSpeed * @method setAngularSpeed
* @param {body} body * @param {body} body
* @param {number} speed * @param {number} speed
@ -613,7 +615,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Moves a body by a given vector relative to its current position, without imparting any velocity by default. * Moves a body by a given vector relative to its current position. By default velocity is unchanged.
* If `updateVelocity` is `true` then velocity is inferred from the change in position. * If `updateVelocity` is `true` then velocity is inferred from the change in position.
* @method translate * @method translate
* @param {body} body * @param {body} body
@ -625,7 +627,7 @@ var Axes = require('../geometry/Axes');
}; };
/** /**
* Rotates a body by a given angle relative to its current angle, without imparting any angular velocity by default. * Rotates a body by a given angle relative to its current angle. By default angular velocity is unchanged.
* If `updateVelocity` is `true` then angular velocity is inferred from the change in angle. * If `updateVelocity` is `true` then angular velocity is inferred from the change in angle.
* @method rotate * @method rotate
* @param {body} body * @param {body} body
@ -971,7 +973,7 @@ var Axes = require('../geometry/Axes');
/** /**
* Internal only. Use `Body.getSpeed` and `Body.setSpeed` instead. * Internal only. Use `Body.getSpeed` and `Body.setSpeed` instead.
* *
* @readOnly * @readOnly
* @property speed * @property speed
* @type number * @type number
@ -980,7 +982,7 @@ var Axes = require('../geometry/Axes');
/** /**
* Internal only. Use `Body.getAngularSpeed` and `Body.setAngularSpeed` instead. * Internal only. Use `Body.getAngularSpeed` and `Body.setAngularSpeed` instead.
* *
* @readOnly * @readOnly
* @property angularSpeed * @property angularSpeed
* @type number * @type number