Browse Source

Merge pull request #12375 from moraxy/objectloader_missing_geometries

ObjectLoader lacking support for some geometries, Docs update
Mr.doob 7 years ago
parent
commit
3066eb9156

+ 2 - 2
docs/api/geometries/PolyhedronBufferGeometry.html

@@ -41,10 +41,10 @@ var geometry = new THREE.PolyhedronBufferGeometry( verticesOfCube, indicesOfFace
 		<h2>Constructor</h2>
 
 
-		<h3>[name]([page:Array vertices], [page:Array faces], [page:Float radius], [page:Integer detail])</h3>
+		<h3>[name]([page:Array vertices], [page:Array indices], [page:Float radius], [page:Integer detail])</h3>
 		<div>
 		vertices — [page:Array] of points of the form [1,1,1, -1,-1,-1, ... ] <br />
-		faces — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
+		indices — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
 		radius — [page:Float] - The radius of the final shape <br />
 		detail — [page:Integer] - How many levels to subdivide the geometry. The more detail, the smoother the shape.
 		</div>

+ 2 - 2
docs/api/geometries/PolyhedronGeometry.html

@@ -39,10 +39,10 @@ var geometry = new THREE.PolyhedronGeometry( verticesOfCube, indicesOfFaces, 6,
 		<h2>Constructor</h2>
 
 
-		<h3>[name]([page:Array vertices], [page:Array faces], [page:Float radius], [page:Integer detail])</h3>
+		<h3>[name]([page:Array vertices], [page:Array indices], [page:Float radius], [page:Integer detail])</h3>
 		<div>
 		vertices — [page:Array] of points of the form [1,1,1, -1,-1,-1, ... ] <br />
-		faces — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
+		indices — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
 		radius — [page:Float] - The radius of the final shape <br />
 		detail — [page:Integer] - How many levels to subdivide the geometry. The more detail, the smoother the shape.
 		</div>

+ 16 - 0
src/loaders/ObjectLoader.js

@@ -254,9 +254,13 @@ Object.assign( ObjectLoader.prototype, {
 						break;
 
 					case 'DodecahedronGeometry':
+					case 'DodecahedronBufferGeometry':
 					case 'IcosahedronGeometry':
+					case 'IcosahedronBufferGeometry':
 					case 'OctahedronGeometry':
+					case 'OctahedronBufferGeometry':
 					case 'TetrahedronGeometry':
+					case 'TetrahedronBufferGeometry':
 
 						geometry = new Geometries[ data.type ](
 							data.radius,
@@ -318,6 +322,18 @@ Object.assign( ObjectLoader.prototype, {
 
 						break;
 
+					case 'PolyhedronGeometry':
+					case 'PolyhedronBufferGeometry':
+
+						geometry = new Geometries[ data.type ](
+							data.vertices,
+							data.indices,
+							data.radius,
+							data.details
+						);
+
+						break;
+
 					case 'BufferGeometry':
 
 						geometry = bufferGeometryLoader.parse( data );