Skip to content

Commit

Permalink
tweaked simulation constraints
Browse files Browse the repository at this point in the history
krikienoid committed Jul 17, 2016
1 parent b683da7 commit 9de5777
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/flagwaver-ui.js
Original file line number Diff line number Diff line change
@@ -51,10 +51,10 @@
toggleWind : function () {
flagWaverOpts.isWindOn = !flagWaverOpts.isWindOn;
if ( flagWaverOpts.isWindOn ) {
flagWaver.setWind( 300 );
flagWaver.setWind( 200 );
}
else {
flagWaver.setWind( 0 );
flagWaver.setWind( 0.001 );
}
},
flag : {
6 changes: 3 additions & 3 deletions js/flagwaver.js
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@

// Wind settings
var wind = true,
windStrength = 300,
windStrength = 200,
windForce = new THREE.Vector3( 0, 0, 0 );

// Ball settings
@@ -175,7 +175,7 @@
correction;

diff.subVectors( p1.position, p2.position );
currentDist = diff.length();
currentDist = diff.length() / SLACK;
diff.normalize();
correction = diff.multiplyScalar( currentDist - distance );
if ( currentDist > distance ) {
@@ -1106,7 +1106,7 @@
}

function setWind ( value ) {
if ( Util.isNumeric( value ) ) {
if ( Util.isNumeric( value ) && value > 0 ) {
windStrength = value;
}
else {

0 comments on commit 9de5777

Please sign in to comment.