Browse Source

Merge branch 'dev' of github.com:mrdoob/three.js into unify_loaders

Conflicts:
	examples/js/loaders/ColladaLoader.js
	examples/js/loaders/UTF8Loader.js
James Kiefer 10 years ago
parent
commit
fec2de80b4

+ 1 - 1
docs/api/textures/CompressedTexture.html

@@ -26,7 +26,7 @@
 		height -- The height of the biggest mipmap <br />
 		height -- The height of the biggest mipmap <br />
 		format -- The format used in the mipmaps <br />
 		format -- The format used in the mipmaps <br />
 		type -- The type used in the mipmaps <br />
 		type -- The type used in the mipmaps <br />
-		mapping --  How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
+		mapping --  How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
 		wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texels.<br />
 		magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texels.<br />

+ 1 - 1
docs/api/textures/DataTexture.html

@@ -26,7 +26,7 @@
 		height -- The height of the image. <br />
 		height -- The height of the image. <br />
 		format -- The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.<br />
 		format -- The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.<br />
 		type -- The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.<br />
 		type -- The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.<br />
-		mapping -- How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
+		mapping -- How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
 		wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
 		magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.<br />
 		magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.<br />

+ 1 - 1
docs/api/textures/Texture.html

@@ -40,7 +40,7 @@
 
 
 		<h3>[property:object mapping]</h3>
 		<h3>[property:object mapping]</h3>
 		<div>
 		<div>
-		How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.
+		How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.
 		</div>
 		</div>
 
 
 		<h3>[property:number wrapS]</h3>
 		<h3>[property:number wrapS]</h3>

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

@@ -1147,7 +1147,7 @@
 		this.id = "";
 		this.id = "";
 		this.name = "";
 		this.name = "";
 		this.nodes = [];
 		this.nodes = [];
-		this.scene = new THREE.Scene();
+		this.scene = new THREE.Group();
 
 
 	};
 	};
 
 

+ 2 - 33
examples/js/loaders/SceneLoader.js

@@ -187,25 +187,6 @@ THREE.SceneLoader.prototype = {
 
 
 						if ( objJSON.loading === undefined ) {
 						if ( objJSON.loading === undefined ) {
 
 
-							var reservedTypes = {
-								"type": 1, "url": 1, "material": 1,
-								"position": 1, "rotation": 1, "scale" : 1,
-								"visible": 1, "children": 1, "userData": 1,
-								"skin": 1, "morph": 1, "mirroredLoop": 1, "duration": 1
-							};
-
-							var loaderParameters = {};
-
-							for ( var parType in objJSON ) {
-
-								if ( ! ( parType in reservedTypes ) ) {
-
-									loaderParameters[ parType ] = objJSON[ parType ];
-
-								}
-
-							}
-
 							material = result.materials[ objJSON.material ];
 							material = result.materials[ objJSON.material ];
 
 
 							objJSON.loading = true;
 							objJSON.loading = true;
@@ -223,7 +204,7 @@ THREE.SceneLoader.prototype = {
 
 
 							} else {
 							} else {
 
 
-								loader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ), loaderParameters );
+								loader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ) );
 
 
 							}
 							}
 
 
@@ -872,20 +853,8 @@ THREE.SceneLoader.prototype = {
 
 
 			} else if ( geoJSON.type in this.geometryHandlers ) {
 			} else if ( geoJSON.type in this.geometryHandlers ) {
 
 
-				var loaderParameters = {};
-
-				for ( var parType in geoJSON ) {
-
-					if ( parType !== "type" && parType !== "url" ) {
-
-						loaderParameters[ parType ] = geoJSON[ parType ];
-
-					}
-
-				}
-
 				var loader = this.geometryHandlers[ geoJSON.type ][ "loaderObject" ];
 				var loader = this.geometryHandlers[ geoJSON.type ][ "loaderObject" ];
-				loader.load( get_url( geoJSON.url, data.urlBaseType ), create_callback_geometry( geoID ), loaderParameters );
+				loader.load( get_url( geoJSON.url, data.urlBaseType ), create_callback_geometry( geoID ) );
 
 
 			} else if ( geoJSON.type === "embedded" ) {
 			} else if ( geoJSON.type === "embedded" ) {
 
 

+ 2 - 2
examples/js/loaders/UTF8Loader.js

@@ -19,7 +19,7 @@ THREE.UTF8Loader = function () {};
 
 
 THREE.UTF8Loader.prototype.load = function ( jsonUrl, callback, options ) {
 THREE.UTF8Loader.prototype.load = function ( jsonUrl, callback, options ) {
 
 
-	this.downloadModelJson( jsonUrl, options, callback );
+	this.downloadModelJson( jsonUrl, callback, options );
 
 
 };
 };
 
 
@@ -690,7 +690,7 @@ THREE.UTF8Loader.prototype.downloadModel = function ( geometryBase, materialBase
 
 
 };
 };
 
 
-THREE.UTF8Loader.prototype.downloadModelJson = function ( jsonUrl, options, callback ) {
+THREE.UTF8Loader.prototype.downloadModelJson = function ( jsonUrl, callback, options ) {
 
 
 	getJsonRequest( jsonUrl, function( loaded ) {
 	getJsonRequest( jsonUrl, function( loaded ) {
 
 

+ 5 - 0
src/renderers/webgl/WebGLProgram.js

@@ -104,6 +104,11 @@ THREE.WebGLProgram = ( function () {
 					envMapTypeDefine = "ENVMAP_TYPE_SPHERE";
 					envMapTypeDefine = "ENVMAP_TYPE_SPHERE";
 					break;
 					break;
 
 
+				case THREE.UVMapping:
+					console.warn( 'THREE.WebGLProgram: envMap.mapping shouldn\'t be THREE.UVMapping. Using THREE.CubeReflectionMapping instead.')
+					envMapTypeDefine = "ENVMAP_TYPE_CUBE";
+					break;
+
 			}
 			}
 
 
 		}
 		}