Skip to content

Commit 42dc72d

Browse files
committed
Merge branch 'pr/60'
[liabru] corrected some of the param types before merge Conflicts: src/body/Body.js src/collision/Resolver.js src/render/Render.js src/render/RenderPixi.js
2 parents 9561d5d + a940d96 commit 42dc72d

12 files changed

Lines changed: 40 additions & 33 deletions

File tree

src/body/Body.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var Body = {};
2222
/**
2323
* Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.
2424
* All properties have default values, and many are pre-calculated automatically based on other properties.
25-
* See the properites section below for detailed information on what you can pass via the `options` object.
25+
* See the properties section below for detailed information on what you can pass via the `options` object.
2626
* @method create
2727
* @param {} options
2828
* @return {body} body
@@ -515,7 +515,7 @@ var Body = {};
515515
velocityPrevX = body.position.x - body.positionPrev.x,
516516
velocityPrevY = body.position.y - body.positionPrev.y;
517517

518-
// update velocity with verlet integration
518+
// update velocity with Verlet integration
519519
body.velocity.x = (velocityPrevX * frictionAir * correction) + (body.force.x / body.mass) * deltaTimeSquared;
520520
body.velocity.y = (velocityPrevY * frictionAir * correction) + (body.force.y / body.mass) * deltaTimeSquared;
521521

@@ -524,7 +524,7 @@ var Body = {};
524524
body.position.x += body.velocity.x;
525525
body.position.y += body.velocity.y;
526526

527-
// update angular velocity with verlet integration
527+
// update angular velocity with Verlet integration
528528
body.angularVelocity = ((body.angle - body.anglePrev) * frictionAir * correction) + (body.torque / body.inertia) * deltaTimeSquared;
529529
body.anglePrev = body.angle;
530530
body.angle += body.angularVelocity;
@@ -668,7 +668,7 @@ var Body = {};
668668
*
669669
* [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]
670670
*
671-
* 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).
671+
* 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).
672672
* The `Vector` objects are also augmented with additional properties required for efficient collision detection.
673673
*
674674
* Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`).

src/body/Composite.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ var Composite = {};
308308
* Removes all bodies, constraints and composites from the given composite
309309
* Optionally clearing its children recursively
310310
* @method clear
311-
* @param {world} world
311+
* @param {composite} composite
312312
* @param {boolean} keepStatic
313313
* @param {boolean} [deep=false]
314314
*/
@@ -649,4 +649,4 @@ var Composite = {};
649649
* @default []
650650
*/
651651

652-
})();
652+
})();

src/body/World.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var World = {};
1818

1919
/**
2020
* Creates a new world composite. The options parameter is an object that specifies any properties you wish to override the defaults.
21-
* See the properites section below for detailed information on what you can pass via the `options` object.
21+
* See the properties section below for detailed information on what you can pass via the `options` object.
2222
* @method create
2323
* @constructor
2424
* @param {} options
@@ -73,4 +73,4 @@ var World = {};
7373
* @return {world} The original world with the constraint added
7474
*/
7575

76-
})();
76+
})();

src/collision/Pair.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var Pair = {};
1212
* Description
1313
* @method create
1414
* @param {collision} collision
15+
* @param {number} timestamp
1516
* @return {pair} A new pair
1617
*/
1718
Pair.create = function(collision, timestamp) {
@@ -47,6 +48,7 @@ var Pair = {};
4748
* @method update
4849
* @param {pair} pair
4950
* @param {collision} collision
51+
* @param {number} timestamp
5052
*/
5153
Pair.update = function(pair, collision, timestamp) {
5254
var contacts = pair.contacts,
@@ -89,6 +91,7 @@ var Pair = {};
8991
* @method setActive
9092
* @param {pair} pair
9193
* @param {bool} isActive
94+
* @param {number} timestamp
9295
*/
9396
Pair.setActive = function(pair, isActive, timestamp) {
9497
if (isActive) {

src/collision/Pairs.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var Pairs = {};
3131
* @method update
3232
* @param {object} pairs
3333
* @param {collision[]} collisions
34+
* @param {number} timestamp
3435
*/
3536
Pairs.update = function(pairs, collisions, timestamp) {
3637
var pairsList = pairs.list,
@@ -96,6 +97,7 @@ var Pairs = {};
9697
* Description
9798
* @method removeOld
9899
* @param {object} pairs
100+
* @param {number} timestamp
99101
*/
100102
Pairs.removeOld = function(pairs, timestamp) {
101103
var pairsList = pairs.list,
@@ -133,9 +135,9 @@ var Pairs = {};
133135

134136
/**
135137
* Clears the given pairs structure
136-
* @method create
137-
* @param {object} options
138+
* @method clear
138139
* @param {pairs} pairs
140+
* @return {pairs} pairs
139141
*/
140142
Pairs.clear = function(pairs) {
141143
pairs.table = {};
@@ -146,4 +148,4 @@ var Pairs = {};
146148
return pairs;
147149
};
148150

149-
})();
151+
})();

src/collision/Resolver.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ var Resolver = {};
216216
* Description
217217
* @method solveVelocity
218218
* @param {pair[]} pairs
219+
* @param {number} timeScale
219220
*/
220221
Resolver.solveVelocity = function(pairs, timeScale) {
221222
var timeScaleSquared = timeScale * timeScale,
@@ -323,4 +324,4 @@ var Resolver = {};
323324
}
324325
};
325326

326-
})();
327+
})();

src/constraint/Constraint.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* @class Constraint
1010
*/
1111

12-
// TODO: fix instabillity issues with torque
12+
// TODO: fix instability issues with torque
1313
// TODO: linked constraints
1414
// TODO: breakable constraints
15-
// TODO: collidable constraints
15+
// TODO: collision constraints
1616
// TODO: allow constrained bodies to sleep
1717
// TODO: handle 0 length constraints properly
1818
// TODO: impulse caching and warming
@@ -27,7 +27,7 @@ var Constraint = {};
2727
/**
2828
* Creates a new constraint.
2929
* All properties have default values, and many are pre-calculated automatically based on other properties.
30-
* See the properites section below for detailed information on what you can pass via the `options` object.
30+
* See the properties section below for detailed information on what you can pass via the `options` object.
3131
* @method create
3232
* @param {} options
3333
* @return {constraint} constraint
@@ -200,8 +200,8 @@ var Constraint = {};
200200

201201
Sleeping.set(bodyA, false);
202202

203-
// clamp to prevent instabillity
204-
// TODO: solve this properlly
203+
// clamp to prevent instability
204+
// TODO: solve this properly
205205
torque = Common.clamp(torque, -0.01, 0.01);
206206

207207
// keep track of applied impulses for post solving
@@ -220,8 +220,8 @@ var Constraint = {};
220220

221221
Sleeping.set(bodyB, false);
222222

223-
// clamp to prevent instabillity
224-
// TODO: solve this properlly
223+
// clamp to prevent instability
224+
// TODO: solve this properly
225225
torque = Common.clamp(torque, -0.01, 0.01);
226226

227227
// keep track of applied impulses for post solving
@@ -382,10 +382,10 @@ var Constraint = {};
382382

383383
/**
384384
* A `Number` that specifies the target resting length of the constraint.
385-
* It is calculated automatically in `Constraint.create` from intial positions of the `constraint.bodyA` and `constraint.bodyB`.
385+
* It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
386386
*
387387
* @property length
388388
* @type number
389389
*/
390390

391-
})();
391+
})();

src/constraint/MouseConstraint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var MouseConstraint = {};
1515
/**
1616
* Creates a new mouse constraint.
1717
* All properties have default values, and many are pre-calculated automatically based on other properties.
18-
* See the properites section below for detailed information on what you can pass via the `options` object.
18+
* See the properties section below for detailed information on what you can pass via the `options` object.
1919
* @method create
2020
* @param {engine} engine
2121
* @param {} options
@@ -118,7 +118,7 @@ var MouseConstraint = {};
118118
* Triggers mouse constraint events
119119
* @method _triggerEvents
120120
* @private
121-
* @param {mouse} mouse
121+
* @param {mouse} mouseConstraint
122122
*/
123123
var _triggerEvents = function(mouseConstraint) {
124124
var mouse = mouseConstraint.mouse,

src/core/Common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ var Common = {};
208208
/**
209209
* Description
210210
* @method now
211-
* @return {number} the current timestamp (high-res if avaliable)
211+
* @return {number} the current timestamp (high-res if available)
212212
*/
213213
Common.now = function() {
214214
// http://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript
@@ -315,4 +315,4 @@ var Common = {};
315315
return Common._seed / 233280;
316316
};
317317

318-
})();
318+
})();

src/core/Engine.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var Engine = {};
1919
/**
2020
* Creates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults.
2121
* All properties have default values, and many are pre-calculated automatically based on other properties.
22-
* See the properites section below for detailed information on what you can pass via the `options` object.
22+
* See the properties section below for detailed information on what you can pass via the `options` object.
2323
* @method create
2424
* @param {HTMLElement} element
2525
* @param {object} [options]
@@ -200,8 +200,7 @@ var Engine = {};
200200
/**
201201
* Renders the world by calling its defined renderer `engine.render.controller`. Triggers `beforeRender` and `afterRender` events.
202202
* @method render
203-
* @param {engine} engineA
204-
* @param {engine} engineB
203+
* @param {engine} engine
205204
*/
206205
Engine.render = function(engine) {
207206
// create an event object
@@ -511,8 +510,8 @@ var Engine = {};
511510

512511
/**
513512
* A `Boolean` that specifies if the `Engine.run` game loop should use a fixed timestep (otherwise it is variable).
514-
* If timing is fixed, then the apparant simulation speed will change depending on the frame rate (but behaviour will be deterministic).
515-
* If the timing is variable, then the apparant simulation speed will be constant (approximately, but at the cost of determininism).
513+
* If timing is fixed, then the apparent simulation speed will change depending on the frame rate (but behaviour will be deterministic).
514+
* If the timing is variable, then the apparent simulation speed will be constant (approximately, but at the cost of determininism).
516515
*
517516
* @property timing.isFixed
518517
* @type boolean
@@ -522,7 +521,7 @@ var Engine = {};
522521
/**
523522
* A `Number` that specifies the time step between updates in milliseconds.
524523
* If `engine.timing.isFixed` is set to `true`, then `delta` is fixed.
525-
* If it is `false`, then `delta` can dynamically change to maintain the correct apparant simulation speed.
524+
* If it is `false`, then `delta` can dynamically change to maintain the correct apparent simulation speed.
526525
*
527526
* @property timing.delta
528527
* @type number
@@ -570,4 +569,4 @@ var Engine = {};
570569
* @default a Matter.World instance
571570
*/
572571

573-
})();
572+
})();

0 commit comments

Comments
 (0)