2
0
Эх сурвалжийг харах

Renamed *Geometry2 to *TypedGeometry

Mr.doob 11 жил өмнө
parent
commit
adb27e0c66

+ 1 - 1
editor/index.html

@@ -37,7 +37,7 @@
 		<script src="../examples/js/BufferGeometryUtils.js"></script>
 
 		<script src="../examples/js/exporters/BufferGeometryExporter.js"></script>
-		<script src="../examples/js/exporters/Geometry2Exporter.js"></script>
+		<script src="../examples/js/exporters/TypedGeometryExporter.js"></script>
 		<script src="../examples/js/exporters/GeometryExporter.js"></script>
 		<script src="../examples/js/exporters/MaterialExporter.js"></script>
 		<script src="../examples/js/exporters/ObjectExporter.js"></script>

+ 5 - 5
examples/js/exporters/Geometry2Exporter.js → examples/js/exporters/TypedGeometryExporter.js

@@ -2,19 +2,19 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-THREE.Geometry2Exporter = function () {};
+THREE.TypedGeometryExporter = function () {};
 
-THREE.Geometry2Exporter.prototype = {
+THREE.TypedGeometryExporter.prototype = {
 
-	constructor: THREE.Geometry2Exporter,
+	constructor: THREE.TypedGeometryExporter,
 
 	parse: function ( geometry ) {
 
 		var output = {
 			metadata: {
 				version: 4.0,
-				type: 'Geometry2',
-				generator: 'Geometry2Exporter'
+				type: 'TypedGeometry',
+				generator: 'TypedGeometryExporter'
 			}
 		};
 

+ 1 - 1
examples/js/loaders/STLLoader.js

@@ -108,7 +108,7 @@ THREE.STLLoader.prototype.parseBinary = function ( data ) {
 
 	var offset = 0;
 
-	var geometry = new THREE.Geometry2( faces );
+	var geometry = new THREE.TypedGeometry( faces );
 
 	for ( var face = 0; face < faces; face ++ ) {
 

+ 3 - 3
examples/js/wip/CircleGeometry2.js → examples/js/wip/CircleTypedGeometry.js

@@ -3,7 +3,7 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-THREE.CircleGeometry2 = function ( radius, segments, thetaStart, thetaLength ) {
+THREE.CircleTypedGeometry = function ( radius, segments, thetaStart, thetaLength ) {
 
 	this.parameters = {
 		radius: radius,
@@ -64,7 +64,7 @@ THREE.CircleGeometry2 = function ( radius, segments, thetaStart, thetaLength ) {
 
 	}
 
-	THREE.IndexedGeometry2.call( this );
+	THREE.IndexedTypedGeometry.call( this );
 
 	this.setArrays( indices, vertices, normals, uvs );
 
@@ -72,4 +72,4 @@ THREE.CircleGeometry2 = function ( radius, segments, thetaStart, thetaLength ) {
 
 };
 
-THREE.CircleGeometry2.prototype = Object.create( THREE.IndexedGeometry2.prototype );
+THREE.CircleTypedGeometry.prototype = Object.create( THREE.IndexedTypedGeometry.prototype );

+ 3 - 3
examples/js/wip/IndexedGeometry2.js → examples/js/wip/IndexedTypedGeometry.js

@@ -2,15 +2,15 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-THREE.IndexedGeometry2 = function () {
+THREE.IndexedTypedGeometry = function () {
 
 	THREE.BufferGeometry.call( this );
 
 };
 
-THREE.IndexedGeometry2.prototype = Object.create( THREE.BufferGeometry.prototype );
+THREE.IndexedTypedGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
 
-THREE.IndexedGeometry2.prototype.setArrays = function ( indices, vertices, normals, uvs ) {
+THREE.IndexedTypedGeometry.prototype.setArrays = function ( indices, vertices, normals, uvs ) {
 
 	this.indices = indices;
 	this.vertices = vertices;

+ 3 - 3
examples/js/wip/PlaneGeometry2.js → examples/js/wip/PlaneTypedGeometry.js

@@ -3,7 +3,7 @@
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
  */
 
-THREE.PlaneGeometry2 = function ( width, height, widthSegments, heightSegments ) {
+THREE.PlaneTypedGeometry = function ( width, height, widthSegments, heightSegments ) {
 
 	this.parameters = {
 		width: width,
@@ -81,11 +81,11 @@ THREE.PlaneGeometry2 = function ( width, height, widthSegments, heightSegments )
 
 	}
 
-	THREE.IndexedGeometry2.call( this );
+	THREE.IndexedTypedGeometry.call( this );
 
 	this.setArrays( indices, vertices, normals, uvs );
 	this.computeBoundingSphere();
 
 };
 
-THREE.PlaneGeometry2.prototype = Object.create( THREE.IndexedGeometry2.prototype );
+THREE.PlaneTypedGeometry.prototype = Object.create( THREE.IndexedTypedGeometry.prototype );

+ 6 - 6
examples/js/wip/Geometry2.js → examples/js/wip/TypedGeometry.js

@@ -2,7 +2,7 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-THREE.Geometry2 = function ( size ) {
+THREE.TypedGeometry = function ( size ) {
 
 	THREE.BufferGeometry.call( this );
 
@@ -20,9 +20,9 @@ THREE.Geometry2 = function ( size ) {
 
 };
 
-THREE.Geometry2.prototype = Object.create( THREE.BufferGeometry.prototype );
+THREE.TypedGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
 
-THREE.Geometry2.prototype.setArrays = function ( vertices, normals, uvs ) {
+THREE.TypedGeometry.prototype.setArrays = function ( vertices, normals, uvs ) {
 
 	this.vertices = vertices;
 	this.normals = normals;
@@ -36,7 +36,7 @@ THREE.Geometry2.prototype.setArrays = function ( vertices, normals, uvs ) {
 
 };
 
-THREE.Geometry2.prototype.merge = ( function () {
+THREE.TypedGeometry.prototype.merge = ( function () {
 
 	var offset = 0;
 	var normalMatrix = new THREE.Matrix3();
@@ -52,7 +52,7 @@ THREE.Geometry2.prototype.merge = ( function () {
 		var normals = this.attributes[ 'normal' ].array;
 		var uvs = this.attributes[ 'uv' ].array;
 
-		if ( geometry instanceof THREE.Geometry2 ) {
+		if ( geometry instanceof THREE.TypedGeometry ) {
 
 			var vertices2 = geometry.attributes[ 'position' ].array;
 			var normals2 = geometry.attributes[ 'normal' ].array;
@@ -73,7 +73,7 @@ THREE.Geometry2.prototype.merge = ( function () {
 
 			}
 
-		} else if ( geometry instanceof THREE.IndexedGeometry2 ) {
+		} else if ( geometry instanceof THREE.IndexedTypedGeometry ) {
 
 			var indices2 = geometry.attributes[ 'index' ].array;
 			var vertices2 = geometry.attributes[ 'position' ].array;

+ 9 - 9
examples/webgl_geometry_minecraft.html

@@ -49,9 +49,9 @@
 		<script src="js/Detector.js"></script>
 		<script src="js/libs/stats.min.js"></script>
 
-		<script src="js/wip/Geometry2.js"></script>
-		<script src="js/wip/IndexedGeometry2.js"></script>
-		<script src="js/wip/PlaneGeometry2.js"></script>
+		<script src="js/wip/TypedGeometry.js"></script>
+		<script src="js/wip/IndexedTypedGeometry.js"></script>
+		<script src="js/wip/PlaneTypedGeometry.js"></script>
 
 		<script>
 
@@ -96,30 +96,30 @@
 
 				var matrix = new THREE.Matrix4();
 
-				var pxGeometry = new THREE.PlaneGeometry2( 100, 100 );
+				var pxGeometry = new THREE.PlaneTypedGeometry( 100, 100 );
 				pxGeometry.uvs[ 1 ] = 0.5;
 				pxGeometry.uvs[ 3 ] = 0.5;
 				pxGeometry.applyMatrix( matrix.makeRotationY( Math.PI / 2 ) );
 				pxGeometry.applyMatrix( matrix.makeTranslation( 50, 0, 0 ) );
 
-				var nxGeometry = new THREE.PlaneGeometry2( 100, 100 );
+				var nxGeometry = new THREE.PlaneTypedGeometry( 100, 100 );
 				nxGeometry.uvs[ 1 ] = 0.5;
 				nxGeometry.uvs[ 3 ] = 0.5;
 				nxGeometry.applyMatrix( matrix.makeRotationY( - Math.PI / 2 ) );
 				nxGeometry.applyMatrix( matrix.makeTranslation( - 50, 0, 0 ) );
 
-				var pyGeometry = new THREE.PlaneGeometry2( 100, 100 );
+				var pyGeometry = new THREE.PlaneTypedGeometry( 100, 100 );
 				pyGeometry.uvs[ 5 ] = 0.5;
 				pyGeometry.uvs[ 7 ] = 0.5;
 				pyGeometry.applyMatrix( matrix.makeRotationX( - Math.PI / 2 ) );
 				pyGeometry.applyMatrix( matrix.makeTranslation( 0, 50, 0 ) );
 
-				var pzGeometry = new THREE.PlaneGeometry2( 100, 100 );
+				var pzGeometry = new THREE.PlaneTypedGeometry( 100, 100 );
 				pzGeometry.uvs[ 1 ] = 0.5;
 				pzGeometry.uvs[ 3 ] = 0.5;
 				pzGeometry.applyMatrix( matrix.makeTranslation( 0, 0, 50 ) );
 
-				var nzGeometry = new THREE.PlaneGeometry2( 100, 100 );
+				var nzGeometry = new THREE.PlaneTypedGeometry( 100, 100 );
 				nzGeometry.uvs[ 1 ] = 0.5;
 				nzGeometry.uvs[ 3 ] = 0.5;
 				nzGeometry.applyMatrix( matrix.makeRotationY( Math.PI ) );
@@ -127,7 +127,7 @@
 
 				//
 
-				var geometry = new THREE.Geometry2( worldWidth * worldDepth * 2 ); // 2 triangles
+				var geometry = new THREE.TypedGeometry( worldWidth * worldDepth * 2 ); // 2 triangles
 
 				for ( var z = 0; z < worldDepth; z ++ ) {
 

+ 1 - 2
examples/webgl_gpgpu_birds.html

@@ -381,7 +381,6 @@
 				var points = triangles * 3;
 
 				THREE.BufferGeometry.call( this );
-				// THREE.Geometry2.call( this, points );
 
 				var vertices = new THREE.Float32Attribute( points, 3 );
 				var birdColors = new THREE.Float32Attribute( points, 3 );
@@ -457,7 +456,7 @@
 
 			}
 
-			THREE.BirdGeometry.prototype = Object.create( THREE.BufferGeometry.prototype ); // Geometry2
+			THREE.BirdGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
 
 
 			var container, stats;

+ 1 - 0
examples/webgl_loader_stl.html

@@ -45,6 +45,7 @@
 		<script src="../build/three.min.js"></script>
 
 		<script src="js/loaders/STLLoader.js"></script>
+		<script src="js/wip/TypedGeometry.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/libs/stats.min.js"></script>