浏览代码

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

Mr.doob 10 年之前
父节点
当前提交
2258b069ef
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/math/Math.js

+ 1 - 1
src/math/Math.js

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