Skip to content

Commit 0889a78

Browse files
committed
feet -> legs
1 parent 6baefd4 commit 0889a78

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

experiments/03-spiderweb.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
var bodyJointStiffness = 1;
2929

3030
var composite = new this.Composite();
31-
composite.feet = [];
31+
composite.legs = [];
3232

3333
composite.particles.push(new Particle(origin));
3434
composite.particles.push(new Particle(origin.add(new Vec2(0,-10))));
@@ -65,8 +65,8 @@
6565
composite.particles.push(rightFoot);
6666
composite.particles.push(leftFoot);
6767

68-
composite.feet.push(rightFoot);
69-
composite.feet.push(leftFoot);
68+
composite.legs.push(rightFoot);
69+
composite.legs.push(leftFoot);
7070

7171
len = composite.particles.length;
7272
composite.constraints.push(new DistanceConstraint(composite.particles[len-4], composite.particles[len-2], legSeg4Stiffness));
@@ -176,7 +176,7 @@
176176
for (k=0;k<8;++k) {
177177
if (
178178
spider.constraints[j] instanceof DistanceConstraint
179-
&& spider.constraints[j].a == spider.feet[k]
179+
&& spider.constraints[j].a == spider.legs[k]
180180
&& spider.constraints[j].b == spiderweb.particles[i])
181181
{
182182
leftFoot = true;
@@ -190,15 +190,15 @@
190190
}
191191

192192
for (i in spider.constraints) {
193-
if (spider.constraints[i] instanceof DistanceConstraint && spider.constraints[i].a == spider.feet[leg]) {
193+
if (spider.constraints[i] instanceof DistanceConstraint && spider.constraints[i].a == spider.legs[leg]) {
194194
spider.constraints.splice(i, 1);
195195
break;
196196
}
197197
}
198198

199199
if (paths.length > 0) {
200200
shuffle(paths);
201-
spider.constraints.push(new DistanceConstraint(spider.feet[leg], paths[0], 1, 0));
201+
spider.constraints.push(new DistanceConstraint(spider.legs[leg], paths[0], 1, 0));
202202
}
203203
}
204204

@@ -266,6 +266,7 @@
266266
sim.crawl(((legIndex++)*3)%8);
267267
}
268268

269+
269270
sim.frame(16);
270271
sim.draw();
271272
requestAnimFrame(loop);

0 commit comments

Comments
 (0)