Skip to content

Commit 828e936

Browse files
aardgoosemrdoob
authored andcommitted
Documentation: lod property renamed (mrdoob#8628)
* Fix levels property name * correct type of levels array contents * correct spacing of method parameters * Move legacy code to Three.Legacy.js
1 parent 08dcf31 commit 828e936

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

docs/api/objects/LOD.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8" />
55
<base href="../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
@@ -45,16 +45,23 @@ <h2>Properties</h2>
4545

4646

4747

48-
<h3>[property:array objects]</h3>
48+
<h3>[property:array levels]</h3>
4949
<div>
50-
An array of [page:Object3D Object3Ds]
50+
An array of [page:object level] objects
51+
</div>
52+
<div>
53+
level is an object with two properties.
54+
</div>
55+
<div>
56+
distance -- The distance at which to display this level of detail<br />
57+
object -- The Object3D which will be displayed
5158
</div>
5259

5360
<h2>Methods</h2>
5461

5562

5663

57-
<h3>[method:null addLevel]([page:Object3D mesh], [page:Float distance])</h3>
64+
<h3>[method:null addLevel]( [page:Object3D mesh], [page:Float distance] )</h3>
5865
<div>
5966
mesh -- The Object3D to display <br />
6067
distance -- The distance at which to display this level of detail
@@ -64,20 +71,20 @@ <h3>[method:null addLevel]([page:Object3D mesh], [page:Float distance])</h3>
6471
the lower the detail on the mesh.
6572
</div>
6673

67-
<h3>[method:Object3D getObjectForDistance]([page:Float distance])</h3>
74+
<h3>[method:Object3D getObjectForDistance]( [page:Float distance] )</h3>
6875
<div>
6976
Get a reference to the first [page:Object3D] (mesh) that is greater than supplied distance.
7077
</div>
7178

72-
<h3>[method:null update]([page:Camera camera])</h3>
79+
<h3>[method:null update]( [page:Camera camera] )</h3>
7380
<div>
7481
camera -- The current camera
7582
</div>
7683
<div>
7784
Update the visiblility of the level of detail based on the distance from the camera.
7885
</div>
7986

80-
<h3>[method:Object3D clone]([page:Object3D object])</h3>
87+
<h3>[method:Object3D clone]( [page:Object3D object] )</h3>
8188
<div>
8289
object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned LOD Object.
8390
</div>

src/Three.Legacy.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,3 +827,16 @@ THREE.CanvasRenderer = function () {
827827
//
828828

829829
THREE.MeshFaceMaterial = THREE.MultiMaterial;
830+
831+
//
832+
833+
Object.defineProperties( THREE.LOD.prototype, {
834+
objects: {
835+
get: function () {
836+
837+
console.warn( 'THREE.LOD: .objects has been renamed to .levels.' );
838+
return this.levels;
839+
840+
}
841+
}
842+
} );

src/objects/LOD.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ THREE.LOD = function () {
1414
levels: {
1515
enumerable: true,
1616
value: []
17-
},
18-
objects: {
19-
get: function () {
20-
21-
console.warn( 'THREE.LOD: .objects has been renamed to .levels.' );
22-
return this.levels;
23-
24-
}
2517
}
2618
} );
2719

0 commit comments

Comments
 (0)