mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
added docs
This commit is contained in:
parent
95eddb01f7
commit
200fcbe652
3 changed files with 34 additions and 2 deletions
|
@ -633,6 +633,27 @@ var Body = {};
|
||||||
* @default "Body"
|
* @default "Body"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of bodies that make up this body.
|
||||||
|
* The first body in the array must always be a self reference to the current body instance.
|
||||||
|
* All bodies in the `parts` array together form a single rigid compound body.
|
||||||
|
* Parts are allowed to overlap, have gaps or holes or even form concave bodies.
|
||||||
|
* Parts themselves should never be added to a `World`, only the parent body should be.
|
||||||
|
* Use `Body.setParts` when setting parts to ensure correct updates of all properties.
|
||||||
|
*
|
||||||
|
* @property parts
|
||||||
|
* @type body[]
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A self reference if the body is _not_ a part of another body.
|
||||||
|
* Otherwise this is a reference to the body that this is a part of.
|
||||||
|
* See `body.parts`.
|
||||||
|
*
|
||||||
|
* @property parent
|
||||||
|
* @type body
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A `Number` specifying the angle of the body, in radians.
|
* A `Number` specifying the angle of the body, in radians.
|
||||||
*
|
*
|
||||||
|
@ -828,6 +849,17 @@ var Body = {};
|
||||||
* @default 0.1
|
* @default 0.1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A `Number` that defines the static friction of the body (in the Coulomb friction model).
|
||||||
|
* A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used.
|
||||||
|
* The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary.
|
||||||
|
* This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction.
|
||||||
|
*
|
||||||
|
* @property frictionStatic
|
||||||
|
* @type number
|
||||||
|
* @default 0.5
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A `Number` that defines the air friction of the body (air resistance).
|
* A `Number` that defines the air friction of the body (air resistance).
|
||||||
* A value of `0` means the body will never slow as it moves through space.
|
* A value of `0` means the body will never slow as it moves through space.
|
||||||
|
|
|
@ -72,7 +72,7 @@ var Query = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all bodies whose vertices contain the given point, from the given set of bodies.
|
* Returns all bodies whose vertices contain the given point, from the given set of bodies.
|
||||||
* @method ray
|
* @method point
|
||||||
* @param {body[]} bodies
|
* @param {body[]} bodies
|
||||||
* @param {vector} point
|
* @param {vector} point
|
||||||
* @return {body[]} The bodies matching the query
|
* @return {body[]} The bodies matching the query
|
||||||
|
|
|
@ -19,7 +19,7 @@ var Svg = {};
|
||||||
* @method pathToVertices
|
* @method pathToVertices
|
||||||
* @param {SVGPathElement} path
|
* @param {SVGPathElement} path
|
||||||
* @param {Number} [sampleLength=15]
|
* @param {Number} [sampleLength=15]
|
||||||
* @return {Vector} points
|
* @return {Vector[]} points
|
||||||
*/
|
*/
|
||||||
Svg.pathToVertices = function(path, sampleLength) {
|
Svg.pathToVertices = function(path, sampleLength) {
|
||||||
// https://github.com/wout/svg.topoly.js/blob/master/svg.topoly.js
|
// https://github.com/wout/svg.topoly.js/blob/master/svg.topoly.js
|
||||||
|
|
Loading…
Reference in a new issue