Skip to content

Commit

Permalink
added Corbans fix, but still not working..yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor committed May 6, 2010
1 parent ead231a commit 82fe91f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions examples/seneca/point/demos/point-3d.pjs
Expand Up @@ -19,27 +19,27 @@ class Ball {
}

void render() {
if ( vel.y >= (height - d/2 - loc.y) ) {
bounceAcc = vel.y;
vel.y = height - d/2 - loc.y;
if ( this.vel.y >= (height - d/2 - this.loc.y) ) {
bounceAcc = this.vel.y;
this.vel.y = height - d/2 - this.loc.y;
} else {
this.addAcc(g);
}

loc.add(vel);
this.loc.add(this.vel);

//stroke(round((float)(Math.sin(frameCount/30f) + 1) * 128), round((float)(Math.cos(frameCount/40f) + 1) * 128) + index, round((float)(Math.cos(frameCount/30f) + 1) * 128) + index/2);

if ( loc.y >= height - d/2 ) {
vel = new PVector();
if ( this.loc.y >= height - d/2 ) {
this.vel = new PVector();
this.addAcc(new PVector(0, -bounceAcc));
}
}

void addAcc(PVector v) {
acc.add(v);
vel.add(acc);
acc = new PVector();
this.acc.add(v);
this.vel.add(this.acc);
this.acc = new PVector();
}
}

Expand Down

0 comments on commit 82fe91f

Please sign in to comment.