Browse Source

Documentation: lod property renamed (#8628)

* Fix levels property name

* correct type of levels array contents

* correct spacing of method parameters

* Move legacy code to Three.Legacy.js
aardgoose 9 years ago
parent
commit
828e93600e
3 changed files with 27 additions and 15 deletions
  1. 14 7
      docs/api/objects/LOD.html
  2. 13 0
      src/Three.Legacy.js
  3. 0 8
      src/objects/LOD.js

+ 14 - 7
docs/api/objects/LOD.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -45,16 +45,23 @@
 
 
 
 
 
 
-		<h3>[property:array objects]</h3>
+		<h3>[property:array levels]</h3>
 		<div>
 		<div>
-		An array of [page:Object3D Object3Ds]
+		An array of [page:object level] objects
+		</div>
+		<div>
+		level is an object with two properties.
+		</div>
+		<div>
+		distance -- The distance at which to display this level of detail<br />
+		object -- The Object3D which will be displayed
 		</div>
 		</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
 
 
-		<h3>[method:null addLevel]([page:Object3D mesh], [page:Float distance])</h3>
+		<h3>[method:null addLevel]( [page:Object3D mesh], [page:Float distance] )</h3>
 		<div>
 		<div>
 		mesh -- The Object3D to display <br />
 		mesh -- The Object3D to display <br />
 		distance -- The distance at which to display this level of detail
 		distance -- The distance at which to display this level of detail
@@ -64,12 +71,12 @@
 		the lower the detail on the mesh.
 		the lower the detail on the mesh.
 		</div>
 		</div>
 
 
-		<h3>[method:Object3D getObjectForDistance]([page:Float distance])</h3>
+		<h3>[method:Object3D getObjectForDistance]( [page:Float distance] )</h3>
 		<div>
 		<div>
 		Get a reference to the first [page:Object3D] (mesh) that is greater than supplied distance.
 		Get a reference to the first [page:Object3D] (mesh) that is greater than supplied distance.
 		</div>
 		</div>
 
 
-		<h3>[method:null update]([page:Camera camera])</h3>
+		<h3>[method:null update]( [page:Camera camera] )</h3>
 		<div>
 		<div>
 		camera -- The current camera
 		camera -- The current camera
 		</div>
 		</div>
@@ -77,7 +84,7 @@
 		Update the visiblility of the level of detail based on the distance from the camera.
 		Update the visiblility of the level of detail based on the distance from the camera.
 		</div>
 		</div>
 		
 		
-		<h3>[method:Object3D clone]([page:Object3D object])</h3>
+		<h3>[method:Object3D clone]( [page:Object3D object] )</h3>
 		<div>
 		<div>
 		object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned LOD Object.
 		object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned LOD Object.
 		</div>
 		</div>

+ 13 - 0
src/Three.Legacy.js

@@ -827,3 +827,16 @@ THREE.CanvasRenderer = function () {
 //
 //
 
 
 THREE.MeshFaceMaterial = THREE.MultiMaterial;
 THREE.MeshFaceMaterial = THREE.MultiMaterial;
+
+//
+
+Object.defineProperties( THREE.LOD.prototype, {
+	objects: {
+		get: function () {
+
+			console.warn( 'THREE.LOD: .objects has been renamed to .levels.' );
+			return this.levels;
+
+		}
+	}
+} );

+ 0 - 8
src/objects/LOD.js

@@ -14,14 +14,6 @@ THREE.LOD = function () {
 		levels: {
 		levels: {
 			enumerable: true,
 			enumerable: true,
 			value: []
 			value: []
-		},
-		objects: {
-			get: function () {
-
-				console.warn( 'THREE.LOD: .objects has been renamed to .levels.' );
-				return this.levels;
-
-			}
 		}
 		}
 	} );
 	} );