mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
Spellchecking
This commit is contained in:
parent
65d5d9330b
commit
723ddcf572
1 changed files with 6 additions and 6 deletions
|
@ -22,7 +22,7 @@ var Body = {};
|
||||||
/**
|
/**
|
||||||
* Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.
|
* Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.
|
||||||
* All properties have default values, and many are pre-calculated automatically based on other properties.
|
* All properties have default values, and many are pre-calculated automatically based on other properties.
|
||||||
* See the properites section below for detailed information on what you can pass via the `options` object.
|
* See the properties section below for detailed information on what you can pass via the `options` object.
|
||||||
* @method create
|
* @method create
|
||||||
* @param {} options
|
* @param {} options
|
||||||
* @return {body} body
|
* @return {body} body
|
||||||
|
@ -421,7 +421,7 @@ var Body = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applys a mass dependant force to all given bodies.
|
* Applies a mass dependant force to all given bodies.
|
||||||
* @method applyGravityAll
|
* @method applyGravityAll
|
||||||
* @param {body[]} bodies
|
* @param {body[]} bodies
|
||||||
* @param {vector} gravity
|
* @param {vector} gravity
|
||||||
|
@ -440,7 +440,7 @@ var Body = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applys `Body.update` to all given `bodies`.
|
* Applies `Body.update` to all given `bodies`.
|
||||||
* @method updateAll
|
* @method updateAll
|
||||||
* @param {body[]} bodies
|
* @param {body[]} bodies
|
||||||
* @param {number} deltaTime
|
* @param {number} deltaTime
|
||||||
|
@ -482,7 +482,7 @@ var Body = {};
|
||||||
velocityPrevX = body.position.x - body.positionPrev.x,
|
velocityPrevX = body.position.x - body.positionPrev.x,
|
||||||
velocityPrevY = body.position.y - body.positionPrev.y;
|
velocityPrevY = body.position.y - body.positionPrev.y;
|
||||||
|
|
||||||
// update velocity with verlet integration
|
// update velocity with Verlet integration
|
||||||
body.velocity.x = (velocityPrevX * frictionAir * correction) + (body.force.x / body.mass) * deltaTimeSquared;
|
body.velocity.x = (velocityPrevX * frictionAir * correction) + (body.force.x / body.mass) * deltaTimeSquared;
|
||||||
body.velocity.y = (velocityPrevY * frictionAir * correction) + (body.force.y / body.mass) * deltaTimeSquared;
|
body.velocity.y = (velocityPrevY * frictionAir * correction) + (body.force.y / body.mass) * deltaTimeSquared;
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ var Body = {};
|
||||||
body.position.x += body.velocity.x;
|
body.position.x += body.velocity.x;
|
||||||
body.position.y += body.velocity.y;
|
body.position.y += body.velocity.y;
|
||||||
|
|
||||||
// update angular velocity with verlet integration
|
// update angular velocity with Verlet integration
|
||||||
body.angularVelocity = ((body.angle - body.anglePrev) * frictionAir * correction) + (body.torque / body.inertia) * deltaTimeSquared;
|
body.angularVelocity = ((body.angle - body.anglePrev) * frictionAir * correction) + (body.torque / body.inertia) * deltaTimeSquared;
|
||||||
body.anglePrev = body.angle;
|
body.anglePrev = body.angle;
|
||||||
body.angle += body.angularVelocity;
|
body.angle += body.angularVelocity;
|
||||||
|
@ -566,7 +566,7 @@ var Body = {};
|
||||||
*
|
*
|
||||||
* [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]
|
* [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]
|
||||||
*
|
*
|
||||||
* When passed via `Body.create`, the verticies are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation).
|
* When passed via `Body.create`, the vertices are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation).
|
||||||
* The `Vector` objects are also augmented with additional properties required for efficient collision detection.
|
* The `Vector` objects are also augmented with additional properties required for efficient collision detection.
|
||||||
*
|
*
|
||||||
* Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`).
|
* Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`).
|
||||||
|
|
Loading…
Reference in a new issue