瀏覽代碼

Update LOD.js

donutcoffee 5 年之前
父節點
當前提交
87e7600ffa
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      src/objects/LOD.js

+ 9 - 3
src/objects/LOD.js

@@ -14,6 +14,8 @@ function LOD() {
 
 
 	Object3D.call( this );
 	Object3D.call( this );
 
 
+	this._currentLevel = 0;
+
 	this.type = 'LOD';
 	this.type = 'LOD';
 
 
 	Object.defineProperties( this, {
 	Object.defineProperties( this, {
@@ -33,8 +35,6 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 
 	isLOD: true,
 	isLOD: true,
 
 
-	currentLevel: 0,
-
 	copy: function ( source ) {
 	copy: function ( source ) {
 
 
 		Object3D.prototype.copy.call( this, source, false );
 		Object3D.prototype.copy.call( this, source, false );
@@ -81,6 +81,12 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 
 	},
 	},
 
 
+        getCurrentLevel: function () {
+
+                 return this._currentLevel;
+
+	},
+
 	getObjectForDistance: function ( distance ) {
 	getObjectForDistance: function ( distance ) {
 
 
 		var levels = this.levels;
 		var levels = this.levels;
@@ -149,7 +155,7 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 
 			}
 			}
 
 
-			this.currentLevel = i - 1;
+			this._currentLevel = i - 1;
 
 
 			for ( ; i < l; i ++ ) {
 			for ( ; i < l; i ++ ) {