Skip to content
Browse files

Merge pull request #5 from parasyte/master

Fix Arbiter.totalKE()
  • Loading branch information...
2 parents 3195ebc + 2daf39e commit c19d6d6d2a2b008f321c726eded59fc90616ceee @josephg committed
Showing with 6 additions and 8 deletions.
  1. +2 −3 cp.js
  2. +2 −2 cp.min.js
  3. +2 −3 lib/cpArbiter.js
View
5 cp.js
@@ -2676,10 +2676,10 @@ Arbiter.prototype.totalImpulseWithFriction = function()
/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback.
Arbiter.prototype.totalKE = function()
{
- var eCoef = (1 - arb.e)/(1 + arb.e);
+ var eCoef = (1 - this.e)/(1 + this.e);
var sum = 0;
- var contacts = arb.contacts;
+ var contacts = this.contacts;
for(var i=0, count=contacts.length; i<count; i++){
var con = contacts[i];
var jnAcc = con.jnAcc;
@@ -2973,7 +2973,6 @@ Arbiter.prototype.next = function(body)
{
return (this.body_a == body ? this.thread_a_next : this.thread_b_next);
};
-
/* Copyright (c) 2007 Scott Lembcke
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
View
4 cp.min.js
2 additions, 2 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
5 lib/cpArbiter.js
@@ -124,10 +124,10 @@ Arbiter.prototype.totalImpulseWithFriction = function()
/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback.
Arbiter.prototype.totalKE = function()
{
- var eCoef = (1 - arb.e)/(1 + arb.e);
+ var eCoef = (1 - this.e)/(1 + this.e);
var sum = 0;
- var contacts = arb.contacts;
+ var contacts = this.contacts;
for(var i=0, count=contacts.length; i<count; i++){
var con = contacts[i];
var jnAcc = con.jnAcc;
@@ -421,4 +421,3 @@ Arbiter.prototype.next = function(body)
{
return (this.body_a == body ? this.thread_a_next : this.thread_b_next);
};
-

0 comments on commit c19d6d6

Please sign in to comment.
Something went wrong with that request. Please try again.