From b61ee54f279e1f56322418cee77f12c6ec4152ac Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Fri, 10 Jun 2011 17:09:47 +0200 Subject: [PATCH] Renamed all extras/geometries. --- .../geometries/{Cube.js => CubeGeometry.js} | 6 ++-- .../{Cylinder.js => CylinderGeometry.js} | 6 ++-- ...{Icosahedron.js => IcosahedronGeometry.js} | 6 ++-- .../geometries/{Lathe.js => LatheGeometry.js} | 6 ++-- .../geometries/{Plane.js => PlaneGeometry.js} | 6 ++-- .../{Sphere.js => SphereGeometry.js} | 9 +++--- .../geometries/{Text.js => TextGeometry.js} | 22 +++++++------- .../geometries/{Torus.js => TorusGeometry.js} | 6 ++-- .../{TorusKnot.js => TorusKnotGeometry.js} | 6 ++-- utils/build.bat | 2 +- utils/build.py | 30 +++++++++---------- utils/build.sh | 2 +- utils/build.xml | 6 ++-- utils/build_all.bat | 2 +- utils/build_all.sh | 2 +- 15 files changed, 59 insertions(+), 58 deletions(-) rename src/extras/geometries/{Cube.js => CubeGeometry.js} (94%) rename src/extras/geometries/{Cylinder.js => CylinderGeometry.js} (91%) rename src/extras/geometries/{Icosahedron.js => IcosahedronGeometry.js} (95%) rename src/extras/geometries/{Lathe.js => LatheGeometry.js} (89%) rename src/extras/geometries/{Plane.js => PlaneGeometry.js} (86%) rename src/extras/geometries/{Sphere.js => SphereGeometry.js} (91%) rename src/extras/geometries/{Text.js => TextGeometry.js} (98%) rename src/extras/geometries/{Torus.js => TorusGeometry.js} (89%) rename src/extras/geometries/{TorusKnot.js => TorusKnotGeometry.js} (92%) diff --git a/src/extras/geometries/Cube.js b/src/extras/geometries/CubeGeometry.js similarity index 94% rename from src/extras/geometries/Cube.js rename to src/extras/geometries/CubeGeometry.js index 121de59c..39c34ab5 100644 --- a/src/extras/geometries/Cube.js +++ b/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 */ -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 ); @@ -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; diff --git a/src/extras/geometries/Cylinder.js b/src/extras/geometries/CylinderGeometry.js similarity index 91% rename from src/extras/geometries/Cylinder.js rename to src/extras/geometries/CylinderGeometry.js index e6930dcb..8f21012d 100644 --- a/src/extras/geometries/Cylinder.js +++ b/src/extras/geometries/CylinderGeometry.js @@ -4,7 +4,7 @@ * @author fuzzthink */ -THREE.Cylinder = function ( numSegs, topRad, botRad, height, topOffset, botOffset ) { +THREE.CylinderGeometry = function ( numSegs, topRad, botRad, height, topOffset, botOffset ) { 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; diff --git a/src/extras/geometries/Icosahedron.js b/src/extras/geometries/IcosahedronGeometry.js similarity index 95% rename from src/extras/geometries/Icosahedron.js rename to src/extras/geometries/IcosahedronGeometry.js index 3abf1940..fb1e836f 100644 --- a/src/extras/geometries/Icosahedron.js +++ b/src/extras/geometries/IcosahedronGeometry.js @@ -6,7 +6,7 @@ * so it draws the entire texture on the seam-faces, I think... */ -THREE.Icosahedron = function ( subdivisions ) { +THREE.IcosahedronGeometry = function ( subdivisions ) { var scope = this; 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; diff --git a/src/extras/geometries/Lathe.js b/src/extras/geometries/LatheGeometry.js similarity index 89% rename from src/extras/geometries/Lathe.js rename to src/extras/geometries/LatheGeometry.js index f2bb47cc..1461583b 100644 --- a/src/extras/geometries/Lathe.js +++ b/src/extras/geometries/LatheGeometry.js @@ -2,7 +2,7 @@ * @author astrodud / http://astrodud.isgreat.org/ */ -THREE.Lathe = function ( points, steps, angle ) { +THREE.LatheGeometry = function ( points, steps, angle ) { 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; diff --git a/src/extras/geometries/Plane.js b/src/extras/geometries/PlaneGeometry.js similarity index 86% rename from src/extras/geometries/Plane.js rename to src/extras/geometries/PlaneGeometry.js index 17cc4687..09fda51a 100644 --- a/src/extras/geometries/Plane.js +++ b/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 */ -THREE.Plane = function ( width, height, segmentsWidth, segmentsHeight ) { +THREE.PlaneGeometry = function ( width, height, segmentsWidth, segmentsHeight ) { 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; diff --git a/src/extras/geometries/Sphere.js b/src/extras/geometries/SphereGeometry.js similarity index 91% rename from src/extras/geometries/Sphere.js rename to src/extras/geometries/SphereGeometry.js index f9e6bc60..97347db8 100644 --- a/src/extras/geometries/Sphere.js +++ b/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 */ -THREE.Sphere = function ( radius, segmentsWidth, segmentsHeight ) { +THREE.SphereGeometry = function ( radius, segmentsWidth, segmentsHeight ) { THREE.Geometry.call( this ); - var gridX = segmentsWidth || 8, + var radius = radius || 50, + gridX = segmentsWidth || 8, gridY = segmentsHeight || 6; 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; diff --git a/src/extras/geometries/Text.js b/src/extras/geometries/TextGeometry.js similarity index 98% rename from src/extras/geometries/Text.js rename to src/extras/geometries/TextGeometry.js index 72bb03c3..5f99a816 100644 --- a/src/extras/geometries/Text.js +++ b/src/extras/geometries/TextGeometry.js @@ -28,7 +28,7 @@ * */ -THREE.Text = function ( text, parameters ) { +THREE.TextGeometry = function ( text, parameters ) { 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; var parameters = parameters || this.parameters; @@ -144,13 +144,13 @@ THREE.Text.prototype.set = function ( text, parameters ) { 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.computeFaceNormals(); @@ -167,8 +167,8 @@ THREE.Text.prototype.set = function ( text, parameters ) { 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) ); diff --git a/src/extras/geometries/Torus.js b/src/extras/geometries/TorusGeometry.js similarity index 89% rename from src/extras/geometries/Torus.js rename to src/extras/geometries/TorusGeometry.js index 926aadc9..23621f1f 100644 --- a/src/extras/geometries/Torus.js +++ b/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 */ -THREE.Torus = function ( radius, tube, segmentsR, segmentsT ) { +THREE.TorusGeometry = function ( radius, tube, segmentsR, segmentsT ) { 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; diff --git a/src/extras/geometries/TorusKnot.js b/src/extras/geometries/TorusKnotGeometry.js similarity index 92% rename from src/extras/geometries/TorusKnot.js rename to src/extras/geometries/TorusKnotGeometry.js index 1475a9e2..4c26a3e7 100644 --- a/src/extras/geometries/TorusKnot.js +++ b/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 */ -THREE.TorusKnot = function ( radius, tube, segmentsR, segmentsT, p, q, heightScale ) { +THREE.TorusKnotGeometry = function ( radius, tube, segmentsR, segmentsT, p, q, heightScale ) { 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; diff --git a/utils/build.bat b/utils/build.bat index 53b09a72..276a8875 100644 --- a/utils/build.bat +++ b/utils/build.bat @@ -1 +1 @@ -python build.py --common --includes +python build.py --common --minified diff --git a/utils/build.py b/utils/build.py index d1a65a50..bcbc760d 100644 --- a/utils/build.py +++ b/utils/build.py @@ -94,15 +94,15 @@ EXTRAS_FILES = [ 'extras/cameras/FlyCamera.js', 'extras/cameras/RollCamera.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/JSONLoader.js', 'extras/io/BinaryLoader.js', @@ -356,7 +356,7 @@ def makeDebug(text): return text -def buildLib(files, debug, unminified, filename): +def buildLib(files, debug, minified, filename): text = merge(files) @@ -375,7 +375,7 @@ def buildLib(files, debug, unminified, filename): print "Compiling", filename print "=" * 40 - if not unminified: + if minified: text = compress(text) 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('--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('--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') 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('--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('--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') args, remainder = parser.parse_args() @@ -433,7 +433,7 @@ def main(argv=None): args = parse_args() debug = args.debug - unminified = args.unminified + minified = args.minified config = [ ['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: if enabled or args.all: - buildLib(files, debug, unminified, fname_lib) + buildLib(files, debug, minified, fname_lib) if args.includes: buildIncludes(files, fname_inc) diff --git a/utils/build.sh b/utils/build.sh index 277b419d..4229a523 100755 --- a/utils/build.sh +++ b/utils/build.sh @@ -1,3 +1,3 @@ #!/bin/sh -python build.py --common +python build.py --common --minified diff --git a/utils/build.xml b/utils/build.xml index ad305d4f..61137140 100644 --- a/utils/build.xml +++ b/utils/build.xml @@ -27,11 +27,11 @@ - + - + - \ No newline at end of file + diff --git a/utils/build_all.bat b/utils/build_all.bat index 73405931..ea84ddc4 100644 --- a/utils/build_all.bat +++ b/utils/build_all.bat @@ -1 +1 @@ -python build.py --all --includes +python build.py --all --minified diff --git a/utils/build_all.sh b/utils/build_all.sh index 79d38f95..e2bffe29 100755 --- a/utils/build_all.sh +++ b/utils/build_all.sh @@ -1,3 +1,3 @@ #!/bin/sh -python build.py --all +python build.py --all --minified