Clean up white-space.

This commit is contained in:
Jürg Lehni 2014-03-12 13:16:50 +01:00
parent 3dd2d8e8ff
commit 5f00c02e67

View file

@ -67,28 +67,28 @@
for (var i = 0; i < this.numSegment; i ++) { for (var i = 0; i < this.numSegment; i ++) {
if (this.boundOffset[i] < this.radius / 4) if (this.boundOffset[i] < this.radius / 4)
this.boundOffset[i] = this.radius / 4; this.boundOffset[i] = this.radius / 4;
var next = (i + 1) % this.numSegment; var next = (i + 1) % this.numSegment;
var prev = (i > 0) ? i - 1 : this.numSegment - 1; var prev = (i > 0) ? i - 1 : this.numSegment - 1;
var offset = this.boundOffset[i]; var offset = this.boundOffset[i];
offset += (this.radius - offset) / 15; offset += (this.radius - offset) / 15;
offset += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - offset) / 3; offset += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - offset) / 3;
this.boundOffsetBuff[i] = this.boundOffset[i] = offset; this.boundOffsetBuff[i] = this.boundOffset[i] = offset;
} }
}, },
react: function(b) { react: function(b) {
var dist = this.point.getDistance(b.point); var dist = this.point.getDistance(b.point);
if (dist < this.radius + b.radius && dist != 0) { if (dist < this.radius + b.radius && dist != 0) {
var overlap = this.radius + b.radius - dist; var overlap = this.radius + b.radius - dist;
var direc = (this.point - b.point).normalize(overlap * 0.015); var direc = (this.point - b.point).normalize(overlap * 0.015);
this.vector += direc; this.vector += direc;
b.vector -= direc; b.vector -= direc;
this.calcBounds(b); this.calcBounds(b);
b.calcBounds(this); b.calcBounds(this);
this.updateBounds(); this.updateBounds();
b.updateBounds(); b.updateBounds();
} }
}, },
getBoundOffset: function(b) { getBoundOffset: function(b) {