Sfoglia il codice sorgente

Math: randInt return value in range between low (inclusive) and high (exclusive). Thanks @AaronMeyers.

Mr.doob 10 anni fa
parent
commit
2258b069ef
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/math/Math.js

+ 1 - 1
src/math/Math.js

@@ -102,7 +102,7 @@ THREE.Math = {
 
 	randInt: function ( low, high ) {
 
-		return low + Math.floor( Math.random() * ( high - low + 1 ) );
+		return Math.floor( this.randFloat( low, high ) );
 
 	},