فهرست منبع

Renamed all extras/geometries.

Mr.doob 14 سال پیش
والد
کامیت
b61ee54f27

+ 3 - 3
src/extras/geometries/Cube.js → src/extras/geometries/CubeGeometry.js

@@ -3,7 +3,7 @@
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as
  */
  */
 
 
-THREE.Cube = function ( width, height, depth, segmentsWidth, segmentsHeight, segmentsDepth, materials, flipped, sides ) {
+THREE.CubeGeometry = function ( width, height, depth, segmentsWidth, segmentsHeight, segmentsDepth, materials, flipped, sides ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
@@ -182,5 +182,5 @@ THREE.Cube = function ( width, height, depth, segmentsWidth, segmentsHeight, seg
 
 
 };
 };
 
 
-THREE.Cube.prototype = new THREE.Geometry();
-THREE.Cube.prototype.constructor = THREE.Cube;
+THREE.CubeGeometry.prototype = new THREE.Geometry();
+THREE.CubeGeometry.prototype.constructor = THREE.CubeGeometry;

+ 3 - 3
src/extras/geometries/Cylinder.js → src/extras/geometries/CylinderGeometry.js

@@ -4,7 +4,7 @@
  * @author fuzzthink
  * @author fuzzthink
  */
  */
 
 
-THREE.Cylinder = function ( numSegs, topRad, botRad, height, topOffset, botOffset ) {
+THREE.CylinderGeometry = function ( numSegs, topRad, botRad, height, topOffset, botOffset ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
@@ -119,5 +119,5 @@ THREE.Cylinder = function ( numSegs, topRad, botRad, height, topOffset, botOffse
 
 
 };
 };
 
 
-THREE.Cylinder.prototype = new THREE.Geometry();
-THREE.Cylinder.prototype.constructor = THREE.Cylinder;
+THREE.CylinderGeometry.prototype = new THREE.Geometry();
+THREE.CylinderGeometry.prototype.constructor = THREE.CylinderGeometry;

+ 3 - 3
src/extras/geometries/Icosahedron.js → src/extras/geometries/IcosahedronGeometry.js

@@ -6,7 +6,7 @@
  * so it draws the entire texture on the seam-faces, I think...
  * so it draws the entire texture on the seam-faces, I think...
  */
  */
 
 
-THREE.Icosahedron = function ( subdivisions ) {
+THREE.IcosahedronGeometry = function ( subdivisions ) {
 
 
 	var scope = this;
 	var scope = this;
 	var tempScope = new THREE.Geometry();
 	var tempScope = new THREE.Geometry();
@@ -173,5 +173,5 @@ THREE.Icosahedron = function ( subdivisions ) {
 
 
 }
 }
 
 
-THREE.Icosahedron.prototype = new THREE.Geometry();
-THREE.Icosahedron.prototype.constructor = THREE.Icosahedron;
+THREE.IcosahedronGeometry.prototype = new THREE.Geometry();
+THREE.IcosahedronGeometry.prototype.constructor = THREE.IcosahedronGeometry;

+ 3 - 3
src/extras/geometries/Lathe.js → src/extras/geometries/LatheGeometry.js

@@ -2,7 +2,7 @@
  * @author astrodud / http://astrodud.isgreat.org/
  * @author astrodud / http://astrodud.isgreat.org/
  */
  */
 
 
-THREE.Lathe = function ( points, steps, angle ) {
+THREE.LatheGeometry = function ( points, steps, angle ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
@@ -67,5 +67,5 @@ THREE.Lathe = function ( points, steps, angle ) {
 
 
 };
 };
 
 
-THREE.Lathe.prototype = new THREE.Geometry();
-THREE.Lathe.prototype.constructor = THREE.Lathe;
+THREE.LatheGeometry.prototype = new THREE.Geometry();
+THREE.LatheGeometry.prototype.constructor = THREE.LatheGeometry;

+ 3 - 3
src/extras/geometries/Plane.js → src/extras/geometries/PlaneGeometry.js

@@ -3,7 +3,7 @@
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
  */
  */
 
 
-THREE.Plane = function ( width, height, segmentsWidth, segmentsHeight ) {
+THREE.PlaneGeometry = function ( width, height, segmentsWidth, segmentsHeight ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
@@ -57,5 +57,5 @@ THREE.Plane = function ( width, height, segmentsWidth, segmentsHeight ) {
 
 
 };
 };
 
 
-THREE.Plane.prototype = new THREE.Geometry();
-THREE.Plane.prototype.constructor = THREE.Plane;
+THREE.PlaneGeometry.prototype = new THREE.Geometry();
+THREE.PlaneGeometry.prototype.constructor = THREE.PlaneGeometry;

+ 5 - 4
src/extras/geometries/Sphere.js → src/extras/geometries/SphereGeometry.js

@@ -3,11 +3,12 @@
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Sphere.as
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Sphere.as
  */
  */
 
 
-THREE.Sphere = function ( radius, segmentsWidth, segmentsHeight ) {
+THREE.SphereGeometry = function ( radius, segmentsWidth, segmentsHeight ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
-	var gridX = segmentsWidth || 8,
+	var radius = radius || 50,
+	gridX = segmentsWidth || 8,
 	gridY = segmentsHeight || 6;
 	gridY = segmentsHeight || 6;
 
 
 	var i, j, pi = Math.PI;
 	var i, j, pi = Math.PI;
@@ -111,5 +112,5 @@ THREE.Sphere = function ( radius, segmentsWidth, segmentsHeight ) {
 
 
 };
 };
 
 
-THREE.Sphere.prototype = new THREE.Geometry();
-THREE.Sphere.prototype.constructor = THREE.Sphere;
+THREE.SphereGeometry.prototype = new THREE.Geometry();
+THREE.SphereGeometry.prototype.constructor = THREE.SphereGeometry;

+ 11 - 11
src/extras/geometries/Text.js → src/extras/geometries/TextGeometry.js

@@ -28,7 +28,7 @@
  *
  *
  */
  */
  
  
-THREE.Text = function ( text, parameters ) {
+THREE.TextGeometry = function ( text, parameters ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 	
 	
@@ -37,10 +37,10 @@ THREE.Text = function ( text, parameters ) {
 
 
 };
 };
 
 
-THREE.Text.prototype = new THREE.Geometry();
-THREE.Text.prototype.constructor = THREE.Text;
+THREE.TextGeometry.prototype = new THREE.Geometry();
+THREE.TextGeometry.prototype.constructor = THREE.TextGeometry;
 
 
-THREE.Text.prototype.set = function ( text, parameters ) {
+THREE.TextGeometry.prototype.set = function ( text, parameters ) {
 
 
 	this.text = text;
 	this.text = text;
 	var parameters = parameters || this.parameters;
 	var parameters = parameters || this.parameters;
@@ -144,13 +144,13 @@ THREE.Text.prototype.set = function ( text, parameters ) {
             if ( vertices[ k ].equals( contour[ i - 1 ] ) ) break;
             if ( vertices[ k ].equals( contour[ i - 1 ] ) ) break;
 
 
         }
         }
-        
-        f4( j, k, k+vlen, j+vlen );
-        
-    }
+
+		f4( j, k, k+vlen, j+vlen );
+
+	}
 
 
     
     
-    // UVs to be added
+	// UVs to be added
 
 
 	this.computeCentroids();
 	this.computeCentroids();
 	this.computeFaceNormals();
 	this.computeFaceNormals();
@@ -167,8 +167,8 @@ THREE.Text.prototype.set = function ( text, parameters ) {
 		scope.faces.push( new THREE.Face3( a, b, c) );
 		scope.faces.push( new THREE.Face3( a, b, c) );
 
 
 	}
 	}
-    
-    function f4( a, b, c, d ) {
+
+	function f4( a, b, c, d ) {
 
 
 		scope.faces.push( new THREE.Face4( a, b, c, d) );
 		scope.faces.push( new THREE.Face4( a, b, c, d) );
 
 

+ 3 - 3
src/extras/geometries/Torus.js → src/extras/geometries/TorusGeometry.js

@@ -3,7 +3,7 @@
  * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888
  * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888
  */
  */
 
 
-THREE.Torus = function ( radius, tube, segmentsR, segmentsT ) {
+THREE.TorusGeometry = function ( radius, tube, segmentsR, segmentsT ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
@@ -74,5 +74,5 @@ THREE.Torus = function ( radius, tube, segmentsR, segmentsT ) {
 
 
 };
 };
 
 
-THREE.Torus.prototype = new THREE.Geometry();
-THREE.Torus.prototype.constructor = THREE.Torus;
+THREE.TorusGeometry.prototype = new THREE.Geometry();
+THREE.TorusGeometry.prototype.constructor = THREE.TorusGeometry;

+ 3 - 3
src/extras/geometries/TorusKnot.js → src/extras/geometries/TorusKnotGeometry.js

@@ -3,7 +3,7 @@
  * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473
  * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473
  */
  */
 
 
-THREE.TorusKnot = function ( radius, tube, segmentsR, segmentsT, p, q, heightScale ) {
+THREE.TorusKnotGeometry = function ( radius, tube, segmentsR, segmentsT, p, q, heightScale ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
@@ -104,5 +104,5 @@ THREE.TorusKnot = function ( radius, tube, segmentsR, segmentsT, p, q, heightSca
 
 
 };
 };
 
 
-THREE.TorusKnot.prototype = new THREE.Geometry();
-THREE.TorusKnot.prototype.constructor = THREE.TorusKnot;
+THREE.TorusKnotGeometry.prototype = new THREE.Geometry();
+THREE.TorusKnotGeometry.prototype.constructor = THREE.TorusKnotGeometry;

+ 1 - 1
utils/build.bat

@@ -1 +1 @@
-python build.py --common --includes
+python build.py --common --minified

+ 15 - 15
utils/build.py

@@ -94,15 +94,15 @@ EXTRAS_FILES = [
 'extras/cameras/FlyCamera.js',
 'extras/cameras/FlyCamera.js',
 'extras/cameras/RollCamera.js',
 'extras/cameras/RollCamera.js',
 'extras/cameras/TrackballCamera.js',
 'extras/cameras/TrackballCamera.js',
-'extras/geometries/Cube.js',
-'extras/geometries/Cylinder.js',
-'extras/geometries/Icosahedron.js',
-'extras/geometries/Lathe.js',
-'extras/geometries/Plane.js',
-'extras/geometries/Sphere.js',
-'extras/geometries/Torus.js',
-'extras/geometries/TorusKnot.js',
-'extras/geometries/Text.js',
+'extras/geometries/CubeGeometry.js',
+'extras/geometries/CylinderGeometry.js',
+'extras/geometries/IcosahedronGeometry.js',
+'extras/geometries/LatheGeometry.js',
+'extras/geometries/PlaneGeometry.js',
+'extras/geometries/SphereGeometry.js',
+'extras/geometries/TextGeometry.js',
+'extras/geometries/TorusGeometry.js',
+'extras/geometries/TorusKnotGeometry.js',
 'extras/io/Loader.js',
 'extras/io/Loader.js',
 'extras/io/JSONLoader.js',
 'extras/io/JSONLoader.js',
 'extras/io/BinaryLoader.js',
 'extras/io/BinaryLoader.js',
@@ -356,7 +356,7 @@ def makeDebug(text):
 	return text
 	return text
 
 
 
 
-def buildLib(files, debug, unminified, filename):
+def buildLib(files, debug, minified, filename):
 
 
 	text = merge(files)
 	text = merge(files)
 
 
@@ -375,7 +375,7 @@ def buildLib(files, debug, unminified, filename):
 	print "Compiling", filename
 	print "Compiling", filename
 	print "=" * 40
 	print "=" * 40
 
 
-	if not unminified:
+	if minified:
 		text = compress(text)
 		text = compress(text)
 
 
 	output(addHeader(text, filename), folder + filename)
 	output(addHeader(text, filename), folder + filename)
@@ -401,7 +401,7 @@ def parse_args():
 		parser.add_argument('--svg', help='Build ThreeSVG.js', action='store_true')
 		parser.add_argument('--svg', help='Build ThreeSVG.js', action='store_true')
 		parser.add_argument('--dom', help='Build ThreeDOM.js', action='store_true')
 		parser.add_argument('--dom', help='Build ThreeDOM.js', action='store_true')
 		parser.add_argument('--debug', help='Generate debug versions', action='store_const', const=True, default=False)
 		parser.add_argument('--debug', help='Generate debug versions', action='store_const', const=True, default=False)
-		parser.add_argument('--unminified', help='Generate unminified versions', action='store_const', const=True, default=False)
+		parser.add_argument('--minified', help='Generate minified versions', action='store_const', const=True, default=False)
 		parser.add_argument('--all', help='Build all Three.js versions', action='store_true')
 		parser.add_argument('--all', help='Build all Three.js versions', action='store_true')
 
 
 		args = parser.parse_args()
 		args = parser.parse_args()
@@ -416,7 +416,7 @@ def parse_args():
 		parser.add_option('--svg', dest='svg', help='Build ThreeSVG.js', action='store_true')
 		parser.add_option('--svg', dest='svg', help='Build ThreeSVG.js', action='store_true')
 		parser.add_option('--dom', dest='dom', help='Build ThreeDOM.js', action='store_true')
 		parser.add_option('--dom', dest='dom', help='Build ThreeDOM.js', action='store_true')
 		parser.add_option('--debug', dest='debug', help='Generate debug versions', action='store_const', const=True, default=False)
 		parser.add_option('--debug', dest='debug', help='Generate debug versions', action='store_const', const=True, default=False)
-		parser.add_option('--unminified', help='Generate unminified versions', action='store_const', const=True, default=False)
+		parser.add_option('--minified', help='Generate minified versions', action='store_const', const=True, default=False)
 		parser.add_option('--all', dest='all', help='Build all Three.js versions', action='store_true')
 		parser.add_option('--all', dest='all', help='Build all Three.js versions', action='store_true')
 
 
 		args, remainder = parser.parse_args()
 		args, remainder = parser.parse_args()
@@ -433,7 +433,7 @@ def main(argv=None):
 
 
 	args = parse_args()
 	args = parse_args()
 	debug = args.debug
 	debug = args.debug
-	unminified = args.unminified
+	minified = args.minified
 
 
 	config = [
 	config = [
 	['Three', 'includes', COMMON_FILES + EXTRAS_FILES, args.common],
 	['Three', 'includes', COMMON_FILES + EXTRAS_FILES, args.common],
@@ -446,7 +446,7 @@ def main(argv=None):
 
 
 	for fname_lib, fname_inc, files, enabled in config:
 	for fname_lib, fname_inc, files, enabled in config:
 		if enabled or args.all:
 		if enabled or args.all:
-			buildLib(files, debug, unminified, fname_lib)
+			buildLib(files, debug, minified, fname_lib)
 			if args.includes:
 			if args.includes:
 				buildIncludes(files, fname_inc)
 				buildIncludes(files, fname_inc)
 
 

+ 1 - 1
utils/build.sh

@@ -1,3 +1,3 @@
 #!/bin/sh
 #!/bin/sh
 
 
-python build.py --common
+python build.py --common --minified

+ 3 - 3
utils/build.xml

@@ -27,11 +27,11 @@
     	  </exec>
     	  </exec>
     </target>
     </target>
 	
 	
-    <target name="unminified" description="Build debug THREE.js">
+    <target name="minified" description="Build minified THREE.js">
     	<exec executable="${python_dir}python">
     	<exec executable="${python_dir}python">
     	    <arg value="${build_py}"/>
     	    <arg value="${build_py}"/>
     	    <arg value="--all"/>
     	    <arg value="--all"/>
-    	    <arg value="--unminified"/>
+    	    <arg value="--minified"/>
     	  </exec>
     	  </exec>
     </target>
     </target>
-</project>
+</project>

+ 1 - 1
utils/build_all.bat

@@ -1 +1 @@
-python build.py --all --includes
+python build.py --all --minified

+ 1 - 1
utils/build_all.sh

@@ -1,3 +1,3 @@
 #!/bin/sh
 #!/bin/sh
 
 
-python build.py --all
+python build.py --all --minified