Browse Source

Update LOD.js

donutcoffee 5 years ago
parent
commit
87e7600ffa
1 changed files with 9 additions and 3 deletions
  1. 9 3
      src/objects/LOD.js

+ 9 - 3
src/objects/LOD.js

@@ -14,6 +14,8 @@ function LOD() {
 
 	Object3D.call( this );
 
+	this._currentLevel = 0;
+
 	this.type = 'LOD';
 
 	Object.defineProperties( this, {
@@ -33,8 +35,6 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 	isLOD: true,
 
-	currentLevel: 0,
-
 	copy: function ( source ) {
 
 		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 ) {
 
 		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 ++ ) {