Skip to content

Commit

Permalink
Merge pull request #5 from parasyte/master
Browse files Browse the repository at this point in the history
Fix Arbiter.totalKE()
  • Loading branch information
josephg committed Jul 25, 2012
2 parents 3195ebc + 2daf39e commit c19d6d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions cp.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2676,10 +2676,10 @@ Arbiter.prototype.totalImpulseWithFriction = function()
/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback. /// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback.
Arbiter.prototype.totalKE = function() Arbiter.prototype.totalKE = function()
{ {
var eCoef = (1 - arb.e)/(1 + arb.e); var eCoef = (1 - this.e)/(1 + this.e);
var sum = 0; var sum = 0;


var contacts = arb.contacts; var contacts = this.contacts;
for(var i=0, count=contacts.length; i<count; i++){ for(var i=0, count=contacts.length; i<count; i++){
var con = contacts[i]; var con = contacts[i];
var jnAcc = con.jnAcc; var jnAcc = con.jnAcc;
Expand Down Expand Up @@ -2973,7 +2973,6 @@ Arbiter.prototype.next = function(body)
{ {
return (this.body_a == body ? this.thread_a_next : this.thread_b_next); return (this.body_a == body ? this.thread_a_next : this.thread_b_next);
}; };

/* Copyright (c) 2007 Scott Lembcke /* Copyright (c) 2007 Scott Lembcke
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Loading

0 comments on commit c19d6d6

Please sign in to comment.