Skip to content

Commit

Permalink
tweaks to COF and starting constant velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
moxious committed Jan 15, 2018
1 parent fb97539 commit 3daf5ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/model/World.js
Expand Up @@ -134,13 +134,13 @@ export default class World {
const bodyProps = _.merge({
x: numberDefault(opts.x, Math.random() * renderer.width),
y: numberDefault(opts.y, 0),
vx: numberDefault(opts.vx, (Math.random() * 0.5 * (neg ? -1 : 1))),
vy: numberDefault(opts.vy, (Math.random() * 0.5 * (neg ? -1 : 1))),
vx: numberDefault(opts.vx, (0.2/*Math.random() * 0.4 */* (neg ? -1 : 1))),
vy: numberDefault(opts.vy, (0.2/*Math.random() * 0.4 */* (neg ? -1 : 1))),
mass: opts.mass || 0.1, // cannot be zero.
radius: numberDefault(opts.radius, 20),
width: numberDefault(opts.width, 30),
height: numberDefault(opts.height, 30),
cof: numberDefault(opts.cof, 0.7),
cof: numberDefault(opts.cof, 0),
label: opts.label || 'body-' + (++this.bodyCounter),
restitution: numberDefault(opts.restitution, 1),
treatment: opts.treatment || 'dynamic',
Expand Down
2 changes: 1 addition & 1 deletion src/model/worlds/BouncingBalls.js
Expand Up @@ -67,7 +67,7 @@ export default class BouncingBalls extends World {
var edgeBounce = Physics.behavior('edge-collision-detection', {
aabb: viewportBounds,
restitution: 1,
cof: 1,
cof: 0,
});

// resize events
Expand Down
2 changes: 1 addition & 1 deletion src/model/worlds/bumpers/SimpleGridBumpers.js
Expand Up @@ -49,7 +49,7 @@ export default class SimpleGridBumpers extends Bumpers {
vertices: shapes.random(),
treatment: 'static',
restitution: 1,
cof: 1,
cof: 0,
styles: this.component.styleBumper(),
}));
}
Expand Down

0 comments on commit 3daf5ed

Please sign in to comment.