mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Added setCentre. Fix #6065
This commit is contained in:
parent
84cdbdd560
commit
5be749c988
1 changed files with 27 additions and 1 deletions
28
types/matter.d.ts
vendored
28
types/matter.d.ts
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue