Permalink
Browse files

fix Body.getVelAtPoint etc and (hopefully) Body.eachConstraint

  • Loading branch information...
1 parent 190f84c commit e3c3ae0527901f77aa431ed5b8051d8f6855d565 @tnovelli tnovelli committed Oct 8, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/cpBody.js
View
8 lib/cpBody.js
@@ -292,19 +292,19 @@ Body.prototype.applyImpulse = function(j, r)
Body.prototype.getVelAtPoint = function(r)
{
- return vadd(new Vect(this.vx, this.vy), vmult(vperp(r), body.w));
+ return vadd(new Vect(this.vx, this.vy), vmult(vperp(r), this.w));
};
/// Get the velocity on a body (in world units) at a point on the body in world coordinates.
Body.prototype.getVelAtWorldPoint = function(point)
{
- return this.getVelAtPoint(vsub(point, body.p));
+ return this.getVelAtPoint(vsub(point, this.p));
};
/// Get the velocity on a body (in world units) at a point on the body in local coordinates.
Body.prototype.getVelAtLocalPoint = function(point)
{
- return this.getVelAtPoint(vrotate(point, body.rot));
+ return this.getVelAtPoint(vrotate(point, this.rot));
};
Body.prototype.eachShape = function(func)
@@ -318,7 +318,7 @@ Body.prototype.eachConstraint = function(func)
{
var constraint = this.constraintList;
while(constraint) {
- var next = constraint.next(body);
+ var next = constraint.next(this);
func(constraint);
constraint = next;
}

0 comments on commit e3c3ae0

Please sign in to comment.