Added setCentre. Fix #6065

This commit is contained in:
Richard Davey 2022-11-18 21:39:47 +00:00
parent 84cdbdd560
commit 5be749c988

28
types/matter.d.ts vendored
View file

@ -2306,11 +2306,24 @@ declare namespace MatterJS {
* Note that this method will ensure that the first part in `body.parts` will always be the `body`.
* @method setParts
* @param {body} body
* @param [body] parts
* @param {body[]} parts
* @param {bool} [autoHull=true]
*/
static setParts (body: BodyType, parts: BodyType[], autoHull?: boolean): void;
/**
* Set the centre of mass of the body.
* The `centre` is a vector in world-space unless `relative` is set, in which case it is a translation.
* The centre of mass is the point the body rotates about and can be used to simulate non-uniform density.
* This is equal to moving `body.position` but not the `body.vertices`.
* Invalid if the `centre` falls outside the body's convex hull.
* @method setCentre
* @param {body} body
* @param {vector} centre
* @param {bool} relative
*/
static setCentre (body: BodyType, centre: Vector, relative: boolean): void;
/**
* Sets the position of the body instantly. Velocity, angle, force etc. are unchanged.
* @method setPosition
@ -2489,6 +2502,19 @@ declare namespace MatterJS {
*/
setParts (body: BodyType, parts: BodyType[], autoHull?: boolean): void;
/**
* Set the centre of mass of the body.
* The `centre` is a vector in world-space unless `relative` is set, in which case it is a translation.
* The centre of mass is the point the body rotates about and can be used to simulate non-uniform density.
* This is equal to moving `body.position` but not the `body.vertices`.
* Invalid if the `centre` falls outside the body's convex hull.
* @method setCentre
* @param {body} body
* @param {vector} centre
* @param {bool} relative
*/
setCentre (body: BodyType, centre: Vector, relative: boolean): void;
/**
* Sets the position of the body instantly. Velocity, angle, force etc. are unchanged.
* @method setPosition