提交 b61ee54f 编写于 作者: M Mr.doob

Renamed all extras/geometries.

上级 9acdcbb6
......@@ -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;
......@@ -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;
......@@ -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;
......@@ -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;
......@@ -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;
......@@ -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;
......@@ -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) );
......
......@@ -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;
......@@ -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;
python build.py --common --includes
python build.py --common --minified
......@@ -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)
......
#!/bin/sh
python build.py --common
python build.py --common --minified
......@@ -27,11 +27,11 @@
</exec>
</target>
<target name="unminified" description="Build debug THREE.js">
<target name="minified" description="Build minified THREE.js">
<exec executable="${python_dir}python">
<arg value="${build_py}"/>
<arg value="--all"/>
<arg value="--unminified"/>
<arg value="--minified"/>
</exec>
</target>
</project>
\ No newline at end of file
</project>
python build.py --all --includes
python build.py --all --minified
#!/bin/sh
python build.py --all
python build.py --all --minified
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册