Skip to content

Commit

Permalink
jshint RotationalMotorEquation
Browse files Browse the repository at this point in the history
  • Loading branch information
schteppe committed Feb 24, 2013
1 parent e4e21b4 commit 1414adf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 21 deletions.
36 changes: 26 additions & 10 deletions build/cannon.js
Original file line number Diff line number Diff line change
Expand Up @@ -5813,10 +5813,16 @@ CANNON.RotationalMotorEquation.prototype.computeB = function(h){
var invIi = this.invIi;
var invIj = this.invIj;

if(bi.invInertia) invIi.setTrace(bi.invInertia);
else invIi.identity(); // ok?
if(bj.invInertia) invIj.setTrace(bj.invInertia);
else invIj.identity(); // ok?
if(bi.invInertia){
invIi.setTrace(bi.invInertia);
} else {
invIi.identity(); // ok?
}
if(bj.invInertia){
invIj.setTrace(bj.invInertia);
} else {
invIj.identity(); // ok?
}

// g = 0
// gdot = axisA * wi - axisB * wj
Expand Down Expand Up @@ -5845,10 +5851,16 @@ CANNON.RotationalMotorEquation.prototype.computeC = function(){
var invIi = this.invIi;
var invIj = this.invIj;

if(bi.invInertia) invIi.setTrace(bi.invInertia);
else invIi.identity(); // ok?
if(bj.invInertia) invIj.setTrace(bj.invInertia);
else invIj.identity(); // ok?
if(bi.invInertia){
invIi.setTrace(bi.invInertia);
} else {
invIi.identity(); // ok?
}
if(bj.invInertia){
invIj.setTrace(bj.invInertia);
} else {
invIj.identity(); // ok?
}

C += invIi.vmult(axisA).dot(axisB);
C += invIj.vmult(axisB).dot(axisB);
Expand All @@ -5869,8 +5881,12 @@ CANNON.RotationalMotorEquation.prototype.computeGWlambda = function(){
//GWlambda += ulambda.dot(this.ni);

// Angular
if(bi.wlambda) GWlambda += bi.wlambda.dot(axisA);
if(bj.wlambda) GWlambda += bj.wlambda.dot(axisB);
if(bi.wlambda){
GWlambda += bi.wlambda.dot(axisA);
}
if(bj.wlambda){
GWlambda += bj.wlambda.dot(axisB);
}

//console.log("GWlambda:",GWlambda);

Expand Down
Loading

0 comments on commit 1414adf

Please sign in to comment.