提交 1e97815e 编写于 作者: B Ben Houston

add THREE.error/THREE.warning to allow for easy redirection of THREE.js...

add THREE.error/THREE.warning to allow for easy redirection of THREE.js specific errors and warnings.
上级 d1ae0510
...@@ -24,6 +24,33 @@ if ( Math.sign === undefined ) { ...@@ -24,6 +24,33 @@ if ( Math.sign === undefined ) {
} }
THREE.ExceptionErrorHandler = function( message, optionalData ) {
console.error( message );
console.error( optionalData );
var error = new Error( message );
error.optionalData = optionalData;
throw error;
};
THREE.ConsoleErrorHandler = function( message, optionalData ) {
console.error( message );
console.error( optionalData );
};
THREE.ConsoleWarningHandler = function( message, optionalData ) {
console.warn( message );
console.warn( optionalData );
};
THREE.NullHandler = function( message, optionalData ) {
};
// set the default error handlers
THREE.error = THREE.ConsoleErrorHandler;
THREE.warning = THREE.ConsoleWarningHandler;
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 }; THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
...@@ -187,25 +214,25 @@ THREE.RGBA_PVRTC_2BPPV1_Format = 2103; ...@@ -187,25 +214,25 @@ THREE.RGBA_PVRTC_2BPPV1_Format = 2103;
THREE.Projector = function () { THREE.Projector = function () {
console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' ); THREE.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
this.projectVector = function ( vector, camera ) { this.projectVector = function ( vector, camera ) {
console.warn( 'THREE.Projector: .projectVector() is now vector.project().' ); THREE.warning( 'THREE.Projector: .projectVector() is now vector.project().' );
vector.project( camera ); vector.project( camera );
}; };
this.unprojectVector = function ( vector, camera ) { this.unprojectVector = function ( vector, camera ) {
console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' ); THREE.warning( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
vector.unproject( camera ); vector.unproject( camera );
}; };
this.pickingRay = function ( vector, camera ) { this.pickingRay = function ( vector, camera ) {
console.error( 'THREE.Projector: .pickingRay() has been removed.' ); THREE.error( 'THREE.Projector: .pickingRay() has been removed.' );
}; };
...@@ -213,7 +240,7 @@ THREE.Projector = function () { ...@@ -213,7 +240,7 @@ THREE.Projector = function () {
THREE.CanvasRenderer = function () { THREE.CanvasRenderer = function () {
console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' ); THREE.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
this.domElement = document.createElement( 'canvas' ); this.domElement = document.createElement( 'canvas' );
this.clear = function () {}; this.clear = function () {};
......
...@@ -114,21 +114,21 @@ THREE.BufferAttribute.prototype = { ...@@ -114,21 +114,21 @@ THREE.BufferAttribute.prototype = {
THREE.Int8Attribute = function ( data, itemSize ) { THREE.Int8Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
THREE.Uint8Attribute = function ( data, itemSize ) { THREE.Uint8Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
THREE.Uint8ClampedAttribute = function ( data, itemSize ) { THREE.Uint8ClampedAttribute = function ( data, itemSize ) {
console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
...@@ -136,42 +136,42 @@ THREE.Uint8ClampedAttribute = function ( data, itemSize ) { ...@@ -136,42 +136,42 @@ THREE.Uint8ClampedAttribute = function ( data, itemSize ) {
THREE.Int16Attribute = function ( data, itemSize ) { THREE.Int16Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
THREE.Uint16Attribute = function ( data, itemSize ) { THREE.Uint16Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
THREE.Int32Attribute = function ( data, itemSize ) { THREE.Int32Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
THREE.Uint32Attribute = function ( data, itemSize ) { THREE.Uint32Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
THREE.Float32Attribute = function ( data, itemSize ) { THREE.Float32Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
THREE.Float64Attribute = function ( data, itemSize ) { THREE.Float64Attribute = function ( data, itemSize ) {
console.warn( 'THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' ); THREE.warning( 'THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
return new THREE.BufferAttribute( data, itemSize ); return new THREE.BufferAttribute( data, itemSize );
}; };
...@@ -31,7 +31,7 @@ THREE.BufferGeometry.prototype = { ...@@ -31,7 +31,7 @@ THREE.BufferGeometry.prototype = {
if ( attribute instanceof THREE.BufferAttribute === false ) { if ( attribute instanceof THREE.BufferAttribute === false ) {
console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' ); THREE.warning( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
this.attributes[ name ] = { array: arguments[ 1 ], itemSize: arguments[ 2 ] }; this.attributes[ name ] = { array: arguments[ 1 ], itemSize: arguments[ 2 ] };
...@@ -277,7 +277,7 @@ THREE.BufferGeometry.prototype = { ...@@ -277,7 +277,7 @@ THREE.BufferGeometry.prototype = {
if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {
console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.' ); THREE.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.' );
} }
...@@ -331,7 +331,7 @@ THREE.BufferGeometry.prototype = { ...@@ -331,7 +331,7 @@ THREE.BufferGeometry.prototype = {
if ( isNaN( this.boundingSphere.radius ) ) { if ( isNaN( this.boundingSphere.radius ) ) {
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.' ); THREE.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.' );
} }
...@@ -476,7 +476,7 @@ THREE.BufferGeometry.prototype = { ...@@ -476,7 +476,7 @@ THREE.BufferGeometry.prototype = {
this.attributes.normal === undefined || this.attributes.normal === undefined ||
this.attributes.uv === undefined ) { this.attributes.uv === undefined ) {
console.warn( 'Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()' ); THREE.warning( 'Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()' );
return; return;
} }
...@@ -764,7 +764,7 @@ THREE.BufferGeometry.prototype = { ...@@ -764,7 +764,7 @@ THREE.BufferGeometry.prototype = {
if ( geometry instanceof THREE.BufferGeometry === false ) { if ( geometry instanceof THREE.BufferGeometry === false ) {
console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry ); THREE.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry );
return; return;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) { THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) {
console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' ) THREE.warning( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' )
return new THREE.Face3( a, b, c, normal, color, materialIndex ); return new THREE.Face3( a, b, c, normal, color, materialIndex );
}; };
...@@ -565,7 +565,7 @@ THREE.Geometry.prototype = { ...@@ -565,7 +565,7 @@ THREE.Geometry.prototype = {
if ( geometry instanceof THREE.Geometry === false ) { if ( geometry instanceof THREE.Geometry === false ) {
console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry ); THREE.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry );
return; return;
} }
...@@ -675,7 +675,7 @@ THREE.Geometry.prototype = { ...@@ -675,7 +675,7 @@ THREE.Geometry.prototype = {
if ( mesh instanceof THREE.Mesh === false ) { if ( mesh instanceof THREE.Mesh === false ) {
console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh ); THREE.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh );
return; return;
} }
......
...@@ -83,7 +83,7 @@ THREE.Object3D.prototype = { ...@@ -83,7 +83,7 @@ THREE.Object3D.prototype = {
get eulerOrder () { get eulerOrder () {
console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' ); THREE.warning( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
return this.rotation.order; return this.rotation.order;
...@@ -91,7 +91,7 @@ THREE.Object3D.prototype = { ...@@ -91,7 +91,7 @@ THREE.Object3D.prototype = {
set eulerOrder ( value ) { set eulerOrder ( value ) {
console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' ); THREE.warning( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
this.rotation.order = value; this.rotation.order = value;
...@@ -99,13 +99,13 @@ THREE.Object3D.prototype = { ...@@ -99,13 +99,13 @@ THREE.Object3D.prototype = {
get useQuaternion () { get useQuaternion () {
console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); THREE.warning( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
}, },
set useQuaternion ( value ) { set useQuaternion ( value ) {
console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); THREE.warning( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
}, },
...@@ -223,7 +223,7 @@ THREE.Object3D.prototype = { ...@@ -223,7 +223,7 @@ THREE.Object3D.prototype = {
translate: function ( distance, axis ) { translate: function ( distance, axis ) {
console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' ); THREE.warning( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
return this.translateOnAxis( axis, distance ); return this.translateOnAxis( axis, distance );
}, },
...@@ -314,7 +314,7 @@ THREE.Object3D.prototype = { ...@@ -314,7 +314,7 @@ THREE.Object3D.prototype = {
if ( object === this ) { if ( object === this ) {
console.error( "THREE.Object3D.add:", object, "can't be added as a child of itself." ); THREE.error( "THREE.Object3D.add:", object, "can't be added as a child of itself." );
return this; return this;
} }
...@@ -334,7 +334,7 @@ THREE.Object3D.prototype = { ...@@ -334,7 +334,7 @@ THREE.Object3D.prototype = {
} else { } else {
console.error( "THREE.Object3D.add:", object, "is not an instance of THREE.Object3D." ); THREE.error( "THREE.Object3D.add:", object, "is not an instance of THREE.Object3D." );
} }
...@@ -370,7 +370,7 @@ THREE.Object3D.prototype = { ...@@ -370,7 +370,7 @@ THREE.Object3D.prototype = {
getChildByName: function ( name, recursive ) { getChildByName: function ( name, recursive ) {
console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' ); THREE.warning( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
return this.getObjectByName( name, recursive ); return this.getObjectByName( name, recursive );
}, },
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
} else { } else {
console.error( 'THREE.Raycaster: Unsupported camera type.' ); THREE.error( 'THREE.Raycaster: Unsupported camera type.' );
} }
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
if ( objects instanceof Array === false ) { if ( objects instanceof Array === false ) {
console.log( 'THREE.Raycaster.intersectObjects: objects is not an Array.' ); THREE.warning( 'THREE.Raycaster.intersectObjects: objects is not an Array.' );
return intersects; return intersects;
} }
......
...@@ -6,7 +6,7 @@ THREE.GeometryUtils = { ...@@ -6,7 +6,7 @@ THREE.GeometryUtils = {
merge: function ( geometry1, geometry2, materialIndexOffset ) { merge: function ( geometry1, geometry2, materialIndexOffset ) {
console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' ); THREE.warning( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
var matrix; var matrix;
...@@ -25,7 +25,7 @@ THREE.GeometryUtils = { ...@@ -25,7 +25,7 @@ THREE.GeometryUtils = {
center: function ( geometry ) { center: function ( geometry ) {
console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' ); THREE.warning( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
return geometry.center(); return geometry.center();
} }
......
...@@ -81,13 +81,13 @@ THREE.ImageUtils = { ...@@ -81,13 +81,13 @@ THREE.ImageUtils = {
loadCompressedTexture: function () { loadCompressedTexture: function () {
console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' ) THREE.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' )
}, },
loadCompressedTextureCube: function () { loadCompressedTextureCube: function () {
console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' ) THREE.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' )
}, },
......
...@@ -10,9 +10,9 @@ THREE.AnimationHandler = { ...@@ -10,9 +10,9 @@ THREE.AnimationHandler = {
// //
add: function () { console.warn( 'THREE.AnimationHandler.add() has been deprecated.' ); }, add: function () { THREE.warning( 'THREE.AnimationHandler.add() has been deprecated.' ); },
get: function () { console.warn( 'THREE.AnimationHandler.get() has been deprecated.' ); }, get: function () { THREE.warning( 'THREE.AnimationHandler.get() has been deprecated.' ); },
remove: function () { console.warn( 'THREE.AnimationHandler.remove() has been deprecated.' ); }, remove: function () { THREE.warning( 'THREE.AnimationHandler.remove() has been deprecated.' ); },
// //
......
...@@ -43,7 +43,7 @@ THREE.Curve = function () { ...@@ -43,7 +43,7 @@ THREE.Curve = function () {
THREE.Curve.prototype.getPoint = function ( t ) { THREE.Curve.prototype.getPoint = function ( t ) {
console.log( "Warning, getPoint() not implemented!" ); THREE.warning( "Warning, THREE.Curve.getPoint() not implemented!" );
return null; return null;
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
THREE.CubeGeometry = function ( width, height, depth, widthSegments, heightSegments, depthSegments ) { THREE.CubeGeometry = function ( width, height, depth, widthSegments, heightSegments, depthSegments ) {
console.warn( 'THREE.CubeGeometry has been renamed to THREE.BoxGeometry.' ); THREE.warning( 'THREE.CubeGeometry has been renamed to THREE.BoxGeometry.' );
return new THREE.BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ); return new THREE.BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments );
}; };
...@@ -174,7 +174,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { ...@@ -174,7 +174,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
function scalePt2 ( pt, vec, size ) { function scalePt2 ( pt, vec, size ) {
if ( ! vec ) console.log( "die" ); if ( ! vec ) THREE.error( "vec does not exist" );
return vec.clone().multiplyScalar( size ).add( pt ); return vec.clone().multiplyScalar( size ).add( pt );
......
...@@ -27,7 +27,7 @@ THREE.MorphBlendMesh = function( geometry, material ) { ...@@ -27,7 +27,7 @@ THREE.MorphBlendMesh = function( geometry, material ) {
}; };
THREE.MorphBlendMesh.prototype = Object.create( THREE.Mesh.prototype ); THREE.MorphBlendMesh.prototype = Object.create( THREE.Mesh.prototype );
THREE.MorphBlendMesh.prototype.constructor = THREE.MorphBlendMesh; THREE.MorphBlendMesh.prototype.constructor = THREE.MorphBlendMesh;
THREE.MorphBlendMesh.prototype.createAnimation = function ( name, start, end, fps ) { THREE.MorphBlendMesh.prototype.createAnimation = function ( name, start, end, fps ) {
...@@ -221,7 +221,7 @@ THREE.MorphBlendMesh.prototype.playAnimation = function ( name ) { ...@@ -221,7 +221,7 @@ THREE.MorphBlendMesh.prototype.playAnimation = function ( name ) {
} else { } else {
console.warn( "animation[" + name + "] undefined" ); THREE.warning( "animation[" + name + "] undefined" );
} }
......
...@@ -12,7 +12,7 @@ THREE.JSONLoader = function ( showStatus ) { ...@@ -12,7 +12,7 @@ THREE.JSONLoader = function ( showStatus ) {
}; };
THREE.JSONLoader.prototype = Object.create( THREE.Loader.prototype ); THREE.JSONLoader.prototype = Object.create( THREE.Loader.prototype );
THREE.JSONLoader.prototype.constructor = THREE.JSONLoader; THREE.JSONLoader.prototype.constructor = THREE.JSONLoader;
THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) { THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
...@@ -45,7 +45,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex ...@@ -45,7 +45,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
if ( json.metadata !== undefined && json.metadata.type === 'scene' ) { if ( json.metadata !== undefined && json.metadata.type === 'scene' ) {
console.error( 'THREE.JSONLoader: "' + url + '" seems to be a Scene. Use THREE.SceneLoader instead.' ); THREE.error( 'THREE.JSONLoader: "' + url + '" seems to be a Scene. Use THREE.SceneLoader instead.' );
return; return;
} }
...@@ -55,7 +55,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex ...@@ -55,7 +55,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
} else { } else {
console.error( 'THREE.JSONLoader: "' + url + '" seems to be unreachable or the file is empty.' ); THREE.error( 'THREE.JSONLoader: "' + url + '" seems to be unreachable or the file is empty.' );
} }
...@@ -67,7 +67,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex ...@@ -67,7 +67,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
} else { } else {
console.error( 'THREE.JSONLoader: Couldn\'t load "' + url + '" (' + xhr.status + ')' ); THREE.error( 'THREE.JSONLoader: Couldn\'t load "' + url + '" (' + xhr.status + ')' );
} }
...@@ -454,7 +454,7 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) { ...@@ -454,7 +454,7 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
if ( geometry.bones && geometry.bones.length > 0 && ( geometry.skinWeights.length !== geometry.skinIndices.length || geometry.skinIndices.length !== geometry.vertices.length ) ) { if ( geometry.bones && geometry.bones.length > 0 && ( geometry.skinWeights.length !== geometry.skinIndices.length || geometry.skinIndices.length !== geometry.vertices.length ) ) {
console.warn( 'When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' + THREE.warning( 'When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' +
geometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.' ); geometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.' );
} }
......
...@@ -274,13 +274,13 @@ THREE.ObjectLoader.prototype = { ...@@ -274,13 +274,13 @@ THREE.ObjectLoader.prototype = {
if ( geometry === undefined ) { if ( geometry === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined geometry', data.geometry ); THREE.warning( 'THREE.ObjectLoader: Undefined geometry', data.geometry );
} }
if ( material === undefined ) { if ( material === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', data.material ); THREE.warning( 'THREE.ObjectLoader: Undefined material', data.material );
} }
...@@ -295,13 +295,13 @@ THREE.ObjectLoader.prototype = { ...@@ -295,13 +295,13 @@ THREE.ObjectLoader.prototype = {
if ( geometry === undefined ) { if ( geometry === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined geometry', data.geometry ); THREE.warning( 'THREE.ObjectLoader: Undefined geometry', data.geometry );
} }
if ( material === undefined ) { if ( material === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', data.material ); THREE.warning( 'THREE.ObjectLoader: Undefined material', data.material );
} }
...@@ -315,7 +315,7 @@ THREE.ObjectLoader.prototype = { ...@@ -315,7 +315,7 @@ THREE.ObjectLoader.prototype = {
if ( material === undefined ) { if ( material === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', data.material ); THREE.warning( 'THREE.ObjectLoader: Undefined material', data.material );
} }
......
...@@ -54,7 +54,7 @@ THREE.Material.prototype = { ...@@ -54,7 +54,7 @@ THREE.Material.prototype = {
if ( newValue === undefined ) { if ( newValue === undefined ) {
console.warn( "THREE.Material: '" + key + "' parameter is undefined." ); THREE.warning( "THREE.Material: '" + key + "' parameter is undefined." );
continue; continue;
} }
......
...@@ -69,14 +69,14 @@ THREE.PointCloudMaterial.prototype.clone = function () { ...@@ -69,14 +69,14 @@ THREE.PointCloudMaterial.prototype.clone = function () {
THREE.ParticleBasicMaterial = function ( parameters ) { THREE.ParticleBasicMaterial = function ( parameters ) {
console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial.' ); THREE.warning( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial.' );
return new THREE.PointCloudMaterial( parameters ); return new THREE.PointCloudMaterial( parameters );
}; };
THREE.ParticleSystemMaterial = function ( parameters ) { THREE.ParticleSystemMaterial = function ( parameters ) {
console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial.' ); THREE.warning( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial.' );
return new THREE.PointCloudMaterial( parameters ); return new THREE.PointCloudMaterial( parameters );
}; };
...@@ -212,7 +212,7 @@ THREE.Euler.prototype = { ...@@ -212,7 +212,7 @@ THREE.Euler.prototype = {
} else { } else {
console.warn( 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + order ) THREE.warning( 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + order )
} }
......
...@@ -16,7 +16,7 @@ THREE.Matrix3 = function () { ...@@ -16,7 +16,7 @@ THREE.Matrix3 = function () {
if ( arguments.length > 0 ) { if ( arguments.length > 0 ) {
console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); THREE.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' );
} }
...@@ -70,14 +70,14 @@ THREE.Matrix3.prototype = { ...@@ -70,14 +70,14 @@ THREE.Matrix3.prototype = {
multiplyVector3: function ( vector ) { multiplyVector3: function ( vector ) {
console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' ); THREE.warning( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' );
return vector.applyMatrix3( this ); return vector.applyMatrix3( this );
}, },
multiplyVector3Array: function ( a ) { multiplyVector3Array: function ( a ) {
console.warn( 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' ); THREE.warning( 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );
return this.applyToVector3Array( a ); return this.applyToVector3Array( a );
}, },
...@@ -167,7 +167,7 @@ THREE.Matrix3.prototype = { ...@@ -167,7 +167,7 @@ THREE.Matrix3.prototype = {
} else { } else {
console.warn( msg ); THREE.warning( msg );
} }
......
...@@ -24,7 +24,7 @@ THREE.Matrix4 = function () { ...@@ -24,7 +24,7 @@ THREE.Matrix4 = function () {
if ( arguments.length > 0 ) { if ( arguments.length > 0 ) {
console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); THREE.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' );
} }
...@@ -72,7 +72,7 @@ THREE.Matrix4.prototype = { ...@@ -72,7 +72,7 @@ THREE.Matrix4.prototype = {
extractPosition: function ( m ) { extractPosition: function ( m ) {
console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' ); THREE.warning( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' );
return this.copyPosition( m ); return this.copyPosition( m );
}, },
...@@ -125,7 +125,7 @@ THREE.Matrix4.prototype = { ...@@ -125,7 +125,7 @@ THREE.Matrix4.prototype = {
if ( euler instanceof THREE.Euler === false ) { if ( euler instanceof THREE.Euler === false ) {
console.error( 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); THREE.error( 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' );
} }
...@@ -251,7 +251,7 @@ THREE.Matrix4.prototype = { ...@@ -251,7 +251,7 @@ THREE.Matrix4.prototype = {
setRotationFromQuaternion: function ( q ) { setRotationFromQuaternion: function ( q ) {
console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' ); THREE.warning( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );
return this.makeRotationFromQuaternion( q ); return this.makeRotationFromQuaternion( q );
...@@ -338,7 +338,7 @@ THREE.Matrix4.prototype = { ...@@ -338,7 +338,7 @@ THREE.Matrix4.prototype = {
if ( n !== undefined ) { if ( n !== undefined ) {
console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); THREE.warning( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' );
return this.multiplyMatrices( m, n ); return this.multiplyMatrices( m, n );
} }
...@@ -417,21 +417,21 @@ THREE.Matrix4.prototype = { ...@@ -417,21 +417,21 @@ THREE.Matrix4.prototype = {
multiplyVector3: function ( vector ) { multiplyVector3: function ( vector ) {
console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.' ); THREE.warning( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.' );
return vector.applyProjection( this ); return vector.applyProjection( this );
}, },
multiplyVector4: function ( vector ) { multiplyVector4: function ( vector ) {
console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); THREE.warning( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
return vector.applyMatrix4( this ); return vector.applyMatrix4( this );
}, },
multiplyVector3Array: function ( a ) { multiplyVector3Array: function ( a ) {
console.warn( 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' ); THREE.warning( 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );
return this.applyToVector3Array( a ); return this.applyToVector3Array( a );
}, },
...@@ -467,7 +467,7 @@ THREE.Matrix4.prototype = { ...@@ -467,7 +467,7 @@ THREE.Matrix4.prototype = {
rotateAxis: function ( v ) { rotateAxis: function ( v ) {
console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' ); THREE.warning( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' );
v.transformDirection( this ); v.transformDirection( this );
...@@ -475,7 +475,7 @@ THREE.Matrix4.prototype = { ...@@ -475,7 +475,7 @@ THREE.Matrix4.prototype = {
crossVector: function ( vector ) { crossVector: function ( vector ) {
console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); THREE.warning( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
return vector.applyMatrix4( this ); return vector.applyMatrix4( this );
}, },
...@@ -581,7 +581,7 @@ THREE.Matrix4.prototype = { ...@@ -581,7 +581,7 @@ THREE.Matrix4.prototype = {
return function () { return function () {
console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); THREE.warning( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' );
var te = this.elements; var te = this.elements;
return v1.set( te[ 12 ], te[ 13 ], te[ 14 ] ); return v1.set( te[ 12 ], te[ 13 ], te[ 14 ] );
...@@ -642,7 +642,7 @@ THREE.Matrix4.prototype = { ...@@ -642,7 +642,7 @@ THREE.Matrix4.prototype = {
} else { } else {
console.warn( msg ); THREE.warning( msg );
} }
...@@ -659,31 +659,31 @@ THREE.Matrix4.prototype = { ...@@ -659,31 +659,31 @@ THREE.Matrix4.prototype = {
translate: function ( v ) { translate: function ( v ) {
console.warn( 'THREE.Matrix4: .translate() has been removed.' ); THREE.error( 'THREE.Matrix4: .translate() has been removed.' );
}, },
rotateX: function ( angle ) { rotateX: function ( angle ) {
console.warn( 'THREE.Matrix4: .rotateX() has been removed.' ); THREE.error( 'THREE.Matrix4: .rotateX() has been removed.' );
}, },
rotateY: function ( angle ) { rotateY: function ( angle ) {
console.warn( 'THREE.Matrix4: .rotateY() has been removed.' ); THREE.error( 'THREE.Matrix4: .rotateY() has been removed.' );
}, },
rotateZ: function ( angle ) { rotateZ: function ( angle ) {
console.warn( 'THREE.Matrix4: .rotateZ() has been removed.' ); THREE.error( 'THREE.Matrix4: .rotateZ() has been removed.' );
}, },
rotateByAxis: function ( axis, angle ) { rotateByAxis: function ( axis, angle ) {
console.warn( 'THREE.Matrix4: .rotateByAxis() has been removed.' ); THREE.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' );
}, },
......
...@@ -363,7 +363,7 @@ THREE.Quaternion.prototype = { ...@@ -363,7 +363,7 @@ THREE.Quaternion.prototype = {
if ( p !== undefined ) { if ( p !== undefined ) {
console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' ); THREE.warning( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' );
return this.multiplyQuaternions( q, p ); return this.multiplyQuaternions( q, p );
} }
...@@ -392,7 +392,7 @@ THREE.Quaternion.prototype = { ...@@ -392,7 +392,7 @@ THREE.Quaternion.prototype = {
multiplyVector3: function ( vector ) { multiplyVector3: function ( vector ) {
console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' ); THREE.warning( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' );
return vector.applyQuaternion( this ); return vector.applyQuaternion( this );
}, },
......
...@@ -78,7 +78,7 @@ THREE.Vector2.prototype = { ...@@ -78,7 +78,7 @@ THREE.Vector2.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
return this.addVectors( v, w ); return this.addVectors( v, w );
} }
...@@ -112,7 +112,7 @@ THREE.Vector2.prototype = { ...@@ -112,7 +112,7 @@ THREE.Vector2.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
return this.subVectors( v, w ); return this.subVectors( v, w );
} }
......
...@@ -93,7 +93,7 @@ THREE.Vector3.prototype = { ...@@ -93,7 +93,7 @@ THREE.Vector3.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
return this.addVectors( v, w ); return this.addVectors( v, w );
} }
...@@ -130,7 +130,7 @@ THREE.Vector3.prototype = { ...@@ -130,7 +130,7 @@ THREE.Vector3.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
return this.subVectors( v, w ); return this.subVectors( v, w );
} }
...@@ -157,7 +157,7 @@ THREE.Vector3.prototype = { ...@@ -157,7 +157,7 @@ THREE.Vector3.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' );
return this.multiplyVectors( v, w ); return this.multiplyVectors( v, w );
} }
...@@ -198,7 +198,7 @@ THREE.Vector3.prototype = { ...@@ -198,7 +198,7 @@ THREE.Vector3.prototype = {
if ( euler instanceof THREE.Euler === false ) { if ( euler instanceof THREE.Euler === false ) {
console.error( 'THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.' ); THREE.error( 'THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.' );
} }
...@@ -601,7 +601,7 @@ THREE.Vector3.prototype = { ...@@ -601,7 +601,7 @@ THREE.Vector3.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' );
return this.crossVectors( v, w ); return this.crossVectors( v, w );
} }
...@@ -708,19 +708,19 @@ THREE.Vector3.prototype = { ...@@ -708,19 +708,19 @@ THREE.Vector3.prototype = {
setEulerFromRotationMatrix: function ( m, order ) { setEulerFromRotationMatrix: function ( m, order ) {
console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' ); THREE.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' );
}, },
setEulerFromQuaternion: function ( q, order ) { setEulerFromQuaternion: function ( q, order ) {
console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' ); THREE.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' );
}, },
getPositionFromMatrix: function ( m ) { getPositionFromMatrix: function ( m ) {
console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' ); THREE.warning( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' );
return this.setFromMatrixPosition( m ); return this.setFromMatrixPosition( m );
...@@ -728,14 +728,14 @@ THREE.Vector3.prototype = { ...@@ -728,14 +728,14 @@ THREE.Vector3.prototype = {
getScaleFromMatrix: function ( m ) { getScaleFromMatrix: function ( m ) {
console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' ); THREE.warning( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' );
return this.setFromMatrixScale( m ); return this.setFromMatrixScale( m );
}, },
getColumnFromMatrix: function ( index, matrix ) { getColumnFromMatrix: function ( index, matrix ) {
console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' ); THREE.warning( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' );
return this.setFromMatrixColumn( index, matrix ); return this.setFromMatrixColumn( index, matrix );
...@@ -765,7 +765,7 @@ THREE.Vector3.prototype = { ...@@ -765,7 +765,7 @@ THREE.Vector3.prototype = {
}, },
setFromMatrixColumn: function ( index, matrix ) { setFromMatrixColumn: function ( index, matrix ) {
var offset = index * 4; var offset = index * 4;
var me = matrix.elements; var me = matrix.elements;
......
...@@ -105,7 +105,7 @@ THREE.Vector4.prototype = { ...@@ -105,7 +105,7 @@ THREE.Vector4.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
return this.addVectors( v, w ); return this.addVectors( v, w );
} }
...@@ -145,7 +145,7 @@ THREE.Vector4.prototype = { ...@@ -145,7 +145,7 @@ THREE.Vector4.prototype = {
if ( w !== undefined ) { if ( w !== undefined ) {
console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); THREE.warning( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
return this.subVectors( v, w ); return this.subVectors( v, w );
} }
......
...@@ -49,7 +49,7 @@ THREE.Mesh.prototype.getMorphTargetIndexByName = function ( name ) { ...@@ -49,7 +49,7 @@ THREE.Mesh.prototype.getMorphTargetIndexByName = function ( name ) {
} }
console.log( 'THREE.Mesh.getMorphTargetIndexByName: morph target ' + name + ' does not exist. Returning 0.' ); THREE.warning( 'THREE.Mesh.getMorphTargetIndexByName: morph target ' + name + ' does not exist. Returning 0.' );
return 0; return 0;
......
...@@ -109,7 +109,7 @@ THREE.MorphAnimMesh.prototype.playAnimation = function ( label, fps ) { ...@@ -109,7 +109,7 @@ THREE.MorphAnimMesh.prototype.playAnimation = function ( label, fps ) {
} else { } else {
console.warn( 'animation[' + label + '] undefined' ); THREE.warning( 'animation[' + label + '] undefined' );
} }
......
...@@ -157,7 +157,7 @@ THREE.PointCloud.prototype.clone = function ( object ) { ...@@ -157,7 +157,7 @@ THREE.PointCloud.prototype.clone = function ( object ) {
THREE.ParticleSystem = function ( geometry, material ) { THREE.ParticleSystem = function ( geometry, material ) {
console.warn( 'THREE.ParticleSystem has been renamed to THREE.PointCloud.' ); THREE.warning( 'THREE.ParticleSystem has been renamed to THREE.PointCloud.' );
return new THREE.PointCloud( geometry, material ); return new THREE.PointCloud( geometry, material );
}; };
...@@ -69,7 +69,7 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) { ...@@ -69,7 +69,7 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) {
} else { } else {
console.warn( 'THREE.Skeleton bonInverses is the wrong length.' ); THREE.warning( 'THREE.Skeleton bonInverses is the wrong length.' );
this.boneInverses = []; this.boneInverses = [];
......
...@@ -148,7 +148,7 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function( force ) { ...@@ -148,7 +148,7 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function( force ) {
} else { } else {
console.warn( 'THREE.SkinnedMesh unreckognized bindMode: ' + this.bindMode ); THREE.warning( 'THREE.SkinnedMesh unreckognized bindMode: ' + this.bindMode );
} }
......
...@@ -218,7 +218,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -218,7 +218,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} catch ( error ) { } catch ( error ) {
console.error( error ); THREE.error( error );
} }
...@@ -362,12 +362,12 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -362,12 +362,12 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( mediumpAvailable ) { if ( mediumpAvailable ) {
_precision = 'mediump'; _precision = 'mediump';
console.warn( 'THREE.WebGLRenderer: highp not supported, using mediump.' ); THREE.warning( 'THREE.WebGLRenderer: highp not supported, using mediump.' );
} else { } else {
_precision = 'lowp'; _precision = 'lowp';
console.warn( 'THREE.WebGLRenderer: highp and mediump not supported, using lowp.' ); THREE.warning( 'THREE.WebGLRenderer: highp and mediump not supported, using lowp.' );
} }
...@@ -376,7 +376,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -376,7 +376,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( _precision === 'mediump' && ! mediumpAvailable ) { if ( _precision === 'mediump' && ! mediumpAvailable ) {
_precision = 'lowp'; _precision = 'lowp';
console.warn( 'THREE.WebGLRenderer: mediump not supported, using lowp.' ); THREE.warning( 'THREE.WebGLRenderer: mediump not supported, using lowp.' );
} }
...@@ -535,7 +535,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -535,7 +535,7 @@ THREE.WebGLRenderer = function ( parameters ) {
this.setClearColorHex = function ( hex, alpha ) { this.setClearColorHex = function ( hex, alpha ) {
console.warn( 'THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.' ); THREE.warning( 'THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.' );
this.setClearColor( hex, alpha ); this.setClearColor( hex, alpha );
}; };
...@@ -3231,7 +3231,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -3231,7 +3231,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( camera instanceof THREE.Camera === false ) { if ( camera instanceof THREE.Camera === false ) {
console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' ); THREE.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
return; return;
} }
...@@ -4802,7 +4802,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -4802,7 +4802,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( textureUnit >= _maxTextures ) { if ( textureUnit >= _maxTextures ) {
console.warn( 'WebGLRenderer: trying to use ' + textureUnit + ' texture units while this GPU supports only ' + _maxTextures ); THREE.warning( 'WebGLRenderer: trying to use ' + textureUnit + ' texture units while this GPU supports only ' + _maxTextures );
} }
...@@ -5140,7 +5140,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -5140,7 +5140,7 @@ THREE.WebGLRenderer = function ( parameters ) {
default: default:
console.warn( 'THREE.WebGLRenderer: Unknown uniform type: ' + type ); THREE.warning( 'THREE.WebGLRenderer: Unknown uniform type: ' + type );
} }
...@@ -5646,7 +5646,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -5646,7 +5646,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( texture.wrapS !== THREE.ClampToEdgeWrapping || texture.wrapT !== THREE.ClampToEdgeWrapping ) { if ( texture.wrapS !== THREE.ClampToEdgeWrapping || texture.wrapT !== THREE.ClampToEdgeWrapping ) {
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( ' + texture.sourceFile + ' )' ); THREE.warning( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( ' + texture.sourceFile + ' )' );
} }
...@@ -5655,7 +5655,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -5655,7 +5655,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( texture.minFilter !== THREE.NearestFilter && texture.minFilter !== THREE.LinearFilter ) { if ( texture.minFilter !== THREE.NearestFilter && texture.minFilter !== THREE.LinearFilter ) {
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( ' + texture.sourceFile + ' )' ); THREE.warning( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( ' + texture.sourceFile + ' )' );
} }
...@@ -5744,7 +5744,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -5744,7 +5744,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else { } else {
console.warn( "Attempt to load unsupported compressed texture format" ); THREE.warning( "Attempt to load unsupported compressed texture format" );
} }
...@@ -5821,7 +5821,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -5821,7 +5821,7 @@ THREE.WebGLRenderer = function ( parameters ) {
var context = canvas.getContext( '2d' ); var context = canvas.getContext( '2d' );
context.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height ); context.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height );
console.log( 'THREE.WebGLRenderer:', image, 'is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height + '.' ); THREE.warning( 'THREE.WebGLRenderer:', image, 'is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height + '.' );
return canvas; return canvas;
...@@ -5908,7 +5908,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -5908,7 +5908,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else { } else {
console.warn( "Attempt to load unsupported compressed texture format" ); THREE.warning( "Attempt to load unsupported compressed texture format" );
} }
...@@ -6287,7 +6287,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -6287,7 +6287,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( maxBones < object.skeleton.bones.length ) { if ( maxBones < object.skeleton.bones.length ) {
console.warn( 'WebGLRenderer: too many bones - ' + object.skeleton.bones.length + ', this GPU supports just ' + maxBones + ' (try OpenGL instead of ANGLE)' ); THREE.warning( 'WebGLRenderer: too many bones - ' + object.skeleton.bones.length + ', this GPU supports just ' + maxBones + ' (try OpenGL instead of ANGLE)' );
} }
...@@ -6346,25 +6346,25 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -6346,25 +6346,25 @@ THREE.WebGLRenderer = function ( parameters ) {
this.initMaterial = function () { this.initMaterial = function () {
console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
THREE.warning( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
}; };
this.addPrePlugin = function () { this.addPrePlugin = function () {
console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' ); THREE.warning( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
}; };
this.addPostPlugin = function () { this.addPostPlugin = function () {
console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' ); THREE.warning( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
}; };
this.updateShadowMap = function () { this.updateShadowMap = function () {
console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' ); THREE.warning( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
}; };
......
...@@ -37,7 +37,7 @@ THREE.WebGLExtensions = function ( gl ) { ...@@ -37,7 +37,7 @@ THREE.WebGLExtensions = function ( gl ) {
if ( extension === null ) { if ( extension === null ) {
console.log( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' ); THREE.warning( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' );
} }
......
...@@ -336,17 +336,17 @@ THREE.WebGLProgram = ( function () { ...@@ -336,17 +336,17 @@ THREE.WebGLProgram = ( function () {
if ( _gl.getProgramParameter( program, _gl.LINK_STATUS ) === false ) { if ( _gl.getProgramParameter( program, _gl.LINK_STATUS ) === false ) {
console.error( 'THREE.WebGLProgram: Could not initialise shader.' ); THREE.error( 'THREE.WebGLProgram: Could not initialise shader.' );
console.error( 'gl.VALIDATE_STATUS', _gl.getProgramParameter( program, _gl.VALIDATE_STATUS ) ); THREE.error( 'gl.VALIDATE_STATUS', _gl.getProgramParameter( program, _gl.VALIDATE_STATUS ) );
console.error( 'gl.getError()', _gl.getError() ); THREE.error( 'gl.getError()', _gl.getError() );
} }
if ( _gl.getProgramInfoLog( program ) !== '' ) { if ( _gl.getProgramInfoLog( program ) !== '' ) {
console.warn( 'THREE.WebGLProgram: gl.getProgramInfoLog()', _gl.getProgramInfoLog( program ) ); THREE.warning( 'THREE.WebGLProgram: gl.getProgramInfoLog()', _gl.getProgramInfoLog( program ) );
// console.warn( _gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) ); // THREE.warning( _gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) );
// console.warn( _gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) ); // THREE.warning( _gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) );
} }
......
...@@ -23,14 +23,14 @@ THREE.WebGLShader = ( function () { ...@@ -23,14 +23,14 @@ THREE.WebGLShader = ( function () {
if ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === false ) { if ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === false ) {
console.error( 'THREE.WebGLShader: Shader couldn\'t compile.' ); THREE.error( 'THREE.WebGLShader: Shader couldn\'t compile.' );
} }
if ( gl.getShaderInfoLog( shader ) !== '' ) { if ( gl.getShaderInfoLog( shader ) !== '' ) {
console.warn( 'THREE.WebGLShader: gl.getShaderInfoLog()', gl.getShaderInfoLog( shader ) ); THREE.warning( 'THREE.WebGLShader: gl.getShaderInfoLog()', gl.getShaderInfoLog( shader ) );
console.warn( addLineNumbers( string ) ); THREE.warning( addLineNumbers( string ) );
} }
......
...@@ -122,7 +122,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje ...@@ -122,7 +122,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje
light.shadowCascadeArray[ n ] = virtualLight; light.shadowCascadeArray[ n ] = virtualLight;
console.log( "Created virtualLight", virtualLight ); //console.log( "Created virtualLight", virtualLight );
} else { } else {
...@@ -183,7 +183,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje ...@@ -183,7 +183,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje
} else { } else {
console.error( "Unsupported light type for shadow" ); THREE.error( "Unsupported light type for shadow" );
continue; continue;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册