提交 22b4a311 编写于 作者: G gero3

add function definintion to closured functions

上级 7dcec4c5
......@@ -123,7 +123,7 @@ THREE.OrthographicTrackballControls = function ( object, domElement ) {
var vector = new THREE.Vector2();
return function ( pageX, pageY ) {
return function getMouseOnScreen ( pageX, pageY ) {
vector.set(
( pageX - _this.screen.left ) / _this.screen.width,
......@@ -142,7 +142,7 @@ THREE.OrthographicTrackballControls = function ( object, domElement ) {
var objectUp = new THREE.Vector3();
var mouseOnBall = new THREE.Vector3();
return function ( pageX, pageY ) {
return function getMouseProjectionOnBall ( pageX, pageY ) {
mouseOnBall.set(
( pageX - _this.screen.width * 0.5 - _this.screen.left ) / _this.radius,
......
......@@ -115,7 +115,7 @@ THREE.TrackballControls = function ( object, domElement ) {
var vector = new THREE.Vector2();
return function ( pageX, pageY ) {
return function getMouseOnScreen ( pageX, pageY ) {
vector.set(
( pageX - _this.screen.left ) / _this.screen.width,
......@@ -132,7 +132,7 @@ THREE.TrackballControls = function ( object, domElement ) {
var vector = new THREE.Vector2();
return function ( pageX, pageY ) {
return function getMouseOnCircle ( pageX, pageY ) {
vector.set(
( ( pageX - _this.screen.width * 0.5 - _this.screen.left ) / ( _this.screen.width * 0.5 ) ),
......
......@@ -15,7 +15,7 @@ THREE.STLBinaryExporter.prototype = {
var vector = new THREE.Vector3();
var normalMatrixWorld = new THREE.Matrix3();
return function ( scene ) {
return function parse ( scene ) {
var triangles = 0;
scene.traverse( function ( object ) {
......
......@@ -14,7 +14,7 @@ THREE.STLExporter.prototype = {
var vector = new THREE.Vector3();
var normalMatrixWorld = new THREE.Matrix3();
return function ( scene ) {
return function parse ( scene ) {
var output = '';
......
......@@ -103,7 +103,7 @@ THREE.RaytracingRenderer = function ( parameters ) {
}
return function ( rayOrigin, rayDirection, outputColor, recursionDepth ) {
return function spawnRay ( rayOrigin, rayDirection, outputColor, recursionDepth ) {
var ray = raycaster.ray;
......@@ -355,7 +355,7 @@ THREE.RaytracingRenderer = function ( parameters ) {
var tmpVec2 = new THREE.Vector3();
var tmpVec3 = new THREE.Vector3();
return function ( outputVector, point, shading, face, vertices ) {
return function computePixelNormal ( outputVector, point, shading, face, vertices ) {
var faceNormal = face.normal;
var vertexNormals = face.vertexNormals;
......@@ -424,7 +424,7 @@ THREE.RaytracingRenderer = function ( parameters ) {
var pixelColor = new THREE.Color();
return function ( blockX, blockY ) {
return function renderBlock ( blockX, blockY ) {
var index = 0;
......
......@@ -40,7 +40,7 @@ THREE.TypedGeometry.prototype.merge = ( function () {
var offset = 0;
var normalMatrix = new THREE.Matrix3();
return function ( geometry, matrix, startOffset ) {
return function merge ( geometry, matrix, startOffset ) {
if ( startOffset !== undefined ) offset = startOffset;
......
......@@ -77,7 +77,7 @@
<script>
THREE.Shape.Utils.triangulateShape = ( function () {
var pnlTriangulator = new PNLTRI.Triangulator();
return function ( contour, holes ) {
return function triangulateShape ( contour, holes ) {
// console.log("new Triangulation: PnlTri.js " + PNLTRI.REVISION );
return pnlTriangulator.triangulate_polygon( [ contour ].concat(holes) );
};
......
......@@ -123,7 +123,7 @@ THREE.Audio.prototype.updateMatrixWorld = ( function () {
var position = new THREE.Vector3();
return function ( force ) {
return function updateMatrixWorld ( force ) {
THREE.Object3D.prototype.updateMatrixWorld.call( this, force );
......
......@@ -23,7 +23,7 @@ THREE.AudioListener.prototype.updateMatrixWorld = ( function () {
var orientation = new THREE.Vector3();
return function ( force ) {
return function updateMatrixWorld ( force ) {
THREE.Object3D.prototype.updateMatrixWorld.call( this, force );
......
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.Gyroscope = function () {
THREE.Object3D.call( this );
};
THREE.Gyroscope.prototype = Object.create( THREE.Object3D.prototype );
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.Gyroscope = function () {
THREE.Object3D.call( this );
};
THREE.Gyroscope.prototype = Object.create( THREE.Object3D.prototype );
THREE.Gyroscope.prototype.constructor = THREE.Gyroscope;
THREE.Gyroscope.prototype.updateMatrixWorld = ( function () {
var translationObject = new THREE.Vector3();
var quaternionObject = new THREE.Quaternion();
var scaleObject = new THREE.Vector3();
var translationWorld = new THREE.Vector3();
var quaternionWorld = new THREE.Quaternion();
var scaleWorld = new THREE.Vector3();
return function ( force ) {
this.matrixAutoUpdate && this.updateMatrix();
// update matrixWorld
if ( this.matrixWorldNeedsUpdate || force ) {
if ( this.parent ) {
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
this.matrixWorld.decompose( translationWorld, quaternionWorld, scaleWorld );
this.matrix.decompose( translationObject, quaternionObject, scaleObject );
this.matrixWorld.compose( translationWorld, quaternionObject, scaleWorld );
} else {
this.matrixWorld.copy( this.matrix );
}
this.matrixWorldNeedsUpdate = false;
force = true;
}
// update children
for ( var i = 0, l = this.children.length; i < l; i ++ ) {
this.children[ i ].updateMatrixWorld( force );
}
};
}() );
THREE.Gyroscope.prototype.updateMatrixWorld = ( function () {
var translationObject = new THREE.Vector3();
var quaternionObject = new THREE.Quaternion();
var scaleObject = new THREE.Vector3();
var translationWorld = new THREE.Vector3();
var quaternionWorld = new THREE.Quaternion();
var scaleWorld = new THREE.Vector3();
return function updateMatrixWorld ( force ) {
this.matrixAutoUpdate && this.updateMatrix();
// update matrixWorld
if ( this.matrixWorldNeedsUpdate || force ) {
if ( this.parent ) {
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
this.matrixWorld.decompose( translationWorld, quaternionWorld, scaleWorld );
this.matrix.decompose( translationObject, quaternionObject, scaleObject );
this.matrixWorld.compose( translationWorld, quaternionObject, scaleWorld );
} else {
this.matrixWorld.copy( this.matrix );
}
this.matrixWorldNeedsUpdate = false;
force = true;
}
// update children
for ( var i = 0, l = this.children.length; i < l; i ++ ) {
this.children[ i ].updateMatrixWorld( force );
}
};
}() );
......@@ -22,7 +22,7 @@ THREE.ArrowHelper = ( function () {
var coneGeometry = new THREE.CylinderGeometry( 0, 0.5, 1, 5, 1 );
coneGeometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, - 0.5, 0 ) );
return function ( dir, origin, length, color, headLength, headWidth ) {
return function ArrowHelper ( dir, origin, length, color, headLength, headWidth ) {
// dir is assumed to be normalized
......@@ -58,7 +58,7 @@ THREE.ArrowHelper.prototype.setDirection = ( function () {
var axis = new THREE.Vector3();
var radians;
return function ( dir ) {
return function setDirection ( dir ) {
// dir is assumed to be normalized
......
......@@ -59,7 +59,7 @@ THREE.FaceNormalsHelper.prototype.update = ( function () {
var v1 = new THREE.Vector3();
var v2 = new THREE.Vector3();
return function() {
return function update ( ) {
this.object.updateMatrixWorld( true );
......
......@@ -57,7 +57,7 @@ THREE.VertexNormalsHelper.prototype.update = ( function () {
var v1 = new THREE.Vector3();
var v2 = new THREE.Vector3();
return function() {
return function update ( ) {
var keys = [ 'a', 'b', 'c' ];
......
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.Loader = function () {
this.onLoadStart = function () {};
this.onLoadProgress = function () {};
this.onLoadComplete = function () {};
};
THREE.Loader.prototype = {
constructor: THREE.Loader,
crossOrigin: undefined,
extractUrlBase: function ( url ) {
var parts = url.split( '/' );
if ( parts.length === 1 ) return './';
parts.pop();
return parts.join( '/' ) + '/';
},
initMaterials: function ( materials, texturePath, crossOrigin ) {
var array = [];
for ( var i = 0; i < materials.length; ++ i ) {
array[ i ] = this.createMaterial( materials[ i ], texturePath, crossOrigin );
}
return array;
},
needsTangents: function ( materials ) {
for ( var i = 0, il = materials.length; i < il; i ++ ) {
var m = materials[ i ];
if ( m instanceof THREE.ShaderMaterial ) return true;
}
return false;
},
createMaterial: ( function () {
var imageLoader;
return function ( m, texturePath, crossOrigin ) {
var scope = this;
if ( crossOrigin === undefined && scope.crossOrigin !== undefined ) crossOrigin = scope.crossOrigin;
if ( imageLoader === undefined ) imageLoader = new THREE.ImageLoader();
function nearest_pow2( n ) {
var l = Math.log( n ) / Math.LN2;
return Math.pow( 2, Math.round( l ) );
}
function create_texture( where, name, sourceFile, repeat, offset, wrap, anisotropy ) {
var fullPath = texturePath + sourceFile;
var texture;
var loader = THREE.Loader.Handlers.get( fullPath );
if ( loader !== null ) {
texture = loader.load( fullPath );
} else {
texture = new THREE.Texture();
loader = imageLoader;
loader.setCrossOrigin( crossOrigin );
loader.load( fullPath, function ( image ) {
if ( THREE.Math.isPowerOfTwo( image.width ) === false ||
THREE.Math.isPowerOfTwo( image.height ) === false ) {
var width = nearest_pow2( image.width );
var height = nearest_pow2( image.height );
var canvas = document.createElement( 'canvas' );
canvas.width = width;
canvas.height = height;
var context = canvas.getContext( '2d' );
context.drawImage( image, 0, 0, width, height );
texture.image = canvas;
} else {
texture.image = image;
}
texture.needsUpdate = true;
} );
}
texture.sourceFile = sourceFile;
if ( repeat ) {
texture.repeat.set( repeat[ 0 ], repeat[ 1 ] );
if ( repeat[ 0 ] !== 1 ) texture.wrapS = THREE.RepeatWrapping;
if ( repeat[ 1 ] !== 1 ) texture.wrapT = THREE.RepeatWrapping;
}
if ( offset ) {
texture.offset.set( offset[ 0 ], offset[ 1 ] );
}
if ( wrap ) {
var wrapMap = {
'repeat': THREE.RepeatWrapping,
'mirror': THREE.MirroredRepeatWrapping
};
if ( wrapMap[ wrap[ 0 ] ] !== undefined ) texture.wrapS = wrapMap[ wrap[ 0 ] ];
if ( wrapMap[ wrap[ 1 ] ] !== undefined ) texture.wrapT = wrapMap[ wrap[ 1 ] ];
}
if ( anisotropy ) {
texture.anisotropy = anisotropy;
}
where[ name ] = texture;
}
function rgb2hex( rgb ) {
return ( rgb[ 0 ] * 255 << 16 ) + ( rgb[ 1 ] * 255 << 8 ) + rgb[ 2 ] * 255;
}
// defaults
var mtype = 'MeshLambertMaterial';
var mpars = { color: 0xeeeeee, opacity: 1.0, map: null, lightMap: null, normalMap: null, bumpMap: null, wireframe: false };
// parameters from model file
if ( m.shading ) {
var shading = m.shading.toLowerCase();
if ( shading === 'phong' ) mtype = 'MeshPhongMaterial';
else if ( shading === 'basic' ) mtype = 'MeshBasicMaterial';
}
if ( m.blending !== undefined && THREE[ m.blending ] !== undefined ) {
mpars.blending = THREE[ m.blending ];
}
if ( m.transparent !== undefined ) {
mpars.transparent = m.transparent;
}
if ( m.opacity !== undefined && m.opacity < 1.0 ) {
mpars.transparent = true;
}
if ( m.depthTest !== undefined ) {
mpars.depthTest = m.depthTest;
}
if ( m.depthWrite !== undefined ) {
mpars.depthWrite = m.depthWrite;
}
if ( m.visible !== undefined ) {
mpars.visible = m.visible;
}
if ( m.flipSided !== undefined ) {
mpars.side = THREE.BackSide;
}
if ( m.doubleSided !== undefined ) {
mpars.side = THREE.DoubleSide;
}
if ( m.wireframe !== undefined ) {
mpars.wireframe = m.wireframe;
}
if ( m.vertexColors !== undefined ) {
if ( m.vertexColors === 'face' ) {
mpars.vertexColors = THREE.FaceColors;
} else if ( m.vertexColors ) {
mpars.vertexColors = THREE.VertexColors;
}
}
// colors
if ( m.colorDiffuse ) {
mpars.color = rgb2hex( m.colorDiffuse );
} else if ( m.DbgColor ) {
mpars.color = m.DbgColor;
}
if ( m.colorSpecular ) {
mpars.specular = rgb2hex( m.colorSpecular );
}
if ( m.colorEmissive ) {
mpars.emissive = rgb2hex( m.colorEmissive );
}
// modifiers
if ( m.transparency !== undefined ) {
console.warn( 'THREE.Loader: transparency has been renamed to opacity' );
m.opacity = m.transparency;
}
if ( m.opacity !== undefined ) {
mpars.opacity = m.opacity;
}
if ( m.specularCoef ) {
mpars.shininess = m.specularCoef;
}
// textures
if ( m.mapDiffuse && texturePath ) {
create_texture( mpars, 'map', m.mapDiffuse, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy );
}
if ( m.mapLight && texturePath ) {
create_texture( mpars, 'lightMap', m.mapLight, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy );
}
if ( m.mapAO && texturePath ) {
create_texture( mpars, 'aoMap', m.mapAO, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy );
}
if ( m.mapBump && texturePath ) {
create_texture( mpars, 'bumpMap', m.mapBump, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy );
}
if ( m.mapNormal && texturePath ) {
create_texture( mpars, 'normalMap', m.mapNormal, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy );
}
if ( m.mapSpecular && texturePath ) {
create_texture( mpars, 'specularMap', m.mapSpecular, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy );
}
if ( m.mapAlpha && texturePath ) {
create_texture( mpars, 'alphaMap', m.mapAlpha, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy );
}
//
if ( m.mapBumpScale ) {
mpars.bumpScale = m.mapBumpScale;
}
if ( m.mapNormalFactor ) {
mpars.normalScale = new THREE.Vector2( m.mapNormalFactor, m.mapNormalFactor );
}
var material = new THREE[ mtype ]( mpars );
if ( m.DbgName !== undefined ) material.name = m.DbgName;
return material;
};
} )()
};
THREE.Loader.Handlers = {
handlers: [],
add: function ( regex, loader ) {
this.handlers.push( regex, loader );
},
get: function ( file ) {
for ( var i = 0, l = this.handlers.length; i < l; i += 2 ) {
var regex = this.handlers[ i ];
var loader = this.handlers[ i + 1 ];
if ( regex.test( file ) ) {
return loader;
}
}
return null;
}
};
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.Loader = function () {
this.onLoadStart = function () {};
this.onLoadProgress = function () {};
this.onLoadComplete = function () {};
};
THREE.Loader.prototype = {
constructor: THREE.Loader,
crossOrigin: undefined,
extractUrlBase: function ( url ) {
var parts = url.split( '/' );
if ( parts.length === 1 ) return './';
parts.pop();
return parts.join( '/' ) + '/';
},
initMaterials: function ( materials, texturePath, crossOrigin ) {
var array = [];
for ( var i = 0; i < materials.length; ++ i ) {
array[ i ] = this.createMaterial( materials[ i ], texturePath, crossOrigin );
}
return array;
},
needsTangents: function ( materials ) {
for ( var i = 0, il = materials.length; i < il; i ++ ) {
var m = materials[ i ];
if ( m instanceof THREE.ShaderMaterial ) return true;
}
return false;
},
createMaterial: ( function () {
var imageLoader;
return function createMaterial ( m, texturePath, crossOrigin ) {
var scope = this;
if ( crossOrigin === undefined && scope.crossOrigin !== undefined ) crossOrigin = scope.crossOrigin;
if ( imageLoader === undefined ) imageLoader = new THREE.ImageLoader();
function nearest_pow2( n ) {
var l = Math.log( n ) / Math.LN2;
return Math.pow( 2, Math.round( l ) );
}
function create_texture( where, name, sourceFile, repeat, offset, wrap, anisotropy ) {
var fullPath = texturePath + sourceFile;
var texture;
var loader = THREE.Loader.Handlers.get( fullPath );
if ( loader !== null ) {
texture = loader.load( fullPath );
} else {
texture = new THREE.Texture();
loader = imageLoader;
loader.setCrossOrigin( crossOrigin );
loader.load( fullPath, function ( image ) {
if ( THREE.Math.isPowerOfTwo( image.width ) === false ||
THREE.Math.isPowerOfTwo( image.height ) === false ) {
var width = nearest_pow2( image.width );
var height = nearest_pow2( image.height );
var canvas = document.createElement( 'canvas' );
canvas.width = width;
canvas.height = height;
var context = canvas.getContext( '2d' );
context.drawImage( image, 0, 0, width, height );
texture.image = canvas;
} else {
texture.image = image;
}
texture.needsUpdate = true;
} );
}
texture.sourceFile = sourceFile;
if ( repeat ) {
texture.repeat.set( repeat[ 0 ], repeat[ 1 ] );
if ( repeat[ 0 ] !== 1 ) texture.wrapS = THREE.RepeatWrapping;
if ( repeat[ 1 ] !== 1 ) texture.wrapT = THREE.RepeatWrapping;
}
if ( offset ) {
texture.offset.set( offset[ 0 ], offset[ 1 ] );
}
if ( wrap ) {
var wrapMap = {
'repeat': THREE.RepeatWrapping,
'mirror': THREE.MirroredRepeatWrapping
};
if ( wrapMap[ wrap[ 0 ] ] !== undefined ) texture.wrapS = wrapMap[ wrap[ 0 ] ];
if ( wrapMap[ wrap[ 1 ] ] !== undefined ) texture.wrapT = wrapMap[ wrap[ 1 ] ];
}
if ( anisotropy ) {
texture.anisotropy = anisotropy;
}
where[ name ] = texture;
}
function rgb2hex( rgb ) {
return ( rgb[ 0 ] * 255 << 16 ) + ( rgb[ 1 ] * 255 << 8 ) + rgb[ 2 ] * 255;
}
// defaults
var mtype = 'MeshLambertMaterial';
var mpars = { color: 0xeeeeee, opacity: 1.0, map: null, lightMap: null, normalMap: null, bumpMap: null, wireframe: false };
// parameters from model file
if ( m.shading ) {
var shading = m.shading.toLowerCase();
if ( shading === 'phong' ) mtype = 'MeshPhongMaterial';
else if ( shading === 'basic' ) mtype = 'MeshBasicMaterial';
}
if ( m.blending !== undefined && THREE[ m.blending ] !== undefined ) {
mpars.blending = THREE[ m.blending ];
}
if ( m.transparent !== undefined ) {
mpars.transparent = m.transparent;
}
if ( m.opacity !== undefined && m.opacity < 1.0 ) {
mpars.transparent = true;
}
if ( m.depthTest !== undefined ) {
mpars.depthTest = m.depthTest;
}
if ( m.depthWrite !== undefined ) {
mpars.depthWrite = m.depthWrite;
}
if ( m.visible !== undefined ) {
mpars.visible = m.visible;
}
if ( m.flipSided !== undefined ) {
mpars.side = THREE.BackSide;
}
if ( m.doubleSided !== undefined ) {
mpars.side = THREE.DoubleSide;
}
if ( m.wireframe !== undefined ) {
mpars.wireframe = m.wireframe;
}
if ( m.vertexColors !== undefined ) {
if ( m.vertexColors === 'face' ) {
mpars.vertexColors = THREE.FaceColors;
} else if ( m.vertexColors ) {
mpars.vertexColors = THREE.VertexColors;
}
}
// colors
if ( m.colorDiffuse ) {
mpars.color = rgb2hex( m.colorDiffuse );
} else if ( m.DbgColor ) {
mpars.color = m.DbgColor;
}
if ( m.colorSpecular ) {
mpars.specular = rgb2hex( m.colorSpecular );
}
if ( m.colorEmissive ) {
mpars.emissive = rgb2hex( m.colorEmissive );
}
// modifiers
if ( m.transparency !== undefined ) {
console.warn( 'THREE.Loader: transparency has been renamed to opacity' );
m.opacity = m.transparency;
}
if ( m.opacity !== undefined ) {
mpars.opacity = m.opacity;
}
if ( m.specularCoef ) {
mpars.shininess = m.specularCoef;
}
// textures
if ( m.mapDiffuse && texturePath ) {
create_texture( mpars, 'map', m.mapDiffuse, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy );
}
if ( m.mapLight && texturePath ) {
create_texture( mpars, 'lightMap', m.mapLight, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy );
}
if ( m.mapAO && texturePath ) {
create_texture( mpars, 'aoMap', m.mapAO, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy );
}
if ( m.mapBump && texturePath ) {
create_texture( mpars, 'bumpMap', m.mapBump, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy );
}
if ( m.mapNormal && texturePath ) {
create_texture( mpars, 'normalMap', m.mapNormal, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy );
}
if ( m.mapSpecular && texturePath ) {
create_texture( mpars, 'specularMap', m.mapSpecular, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy );
}
if ( m.mapAlpha && texturePath ) {
create_texture( mpars, 'alphaMap', m.mapAlpha, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy );
}
//
if ( m.mapBumpScale ) {
mpars.bumpScale = m.mapBumpScale;
}
if ( m.mapNormalFactor ) {
mpars.normalScale = new THREE.Vector2( m.mapNormalFactor, m.mapNormalFactor );
}
var material = new THREE[ mtype ]( mpars );
if ( m.DbgName !== undefined ) material.name = m.DbgName;
return material;
};
} )()
};
THREE.Loader.Handlers = {
handlers: [],
add: function ( regex, loader ) {
this.handlers.push( regex, loader );
},
get: function ( file ) {
for ( var i = 0, l = this.handlers.length; i < l; i += 2 ) {
var regex = this.handlers[ i ];
var loader = this.handlers[ i + 1 ];
if ( regex.test( file ) ) {
return loader;
}
}
return null;
}
};
......@@ -256,7 +256,7 @@ THREE.Vector2.prototype = {
var min, max;
return function ( minVal, maxVal ) {
return function clampScalar ( minVal, maxVal ) {
if ( min === undefined ) {
......
......@@ -486,7 +486,7 @@ THREE.Vector3.prototype = {
var min, max;
return function ( minVal, maxVal ) {
return function clampScalar ( minVal, maxVal ) {
if ( min === undefined ) {
......
......@@ -498,7 +498,7 @@ THREE.Vector4.prototype = {
var min, max;
return function ( minVal, maxVal ) {
return function clampScalar ( minVal, maxVal ) {
if ( min === undefined ) {
......
......@@ -73,7 +73,7 @@ THREE.LOD.prototype.raycast = ( function () {
var matrixPosition = new THREE.Vector3();
return function ( raycaster, intersects ) {
return function raycast ( raycaster, intersects ) {
matrixPosition.setFromMatrixPosition( this.matrixWorld );
......
......@@ -28,7 +28,7 @@ THREE.Line.prototype.raycast = ( function () {
var ray = new THREE.Ray();
var sphere = new THREE.Sphere();
return function ( raycaster, intersects ) {
return function raycast ( raycaster, intersects ) {
var precision = raycaster.linePrecision;
var precisionSq = precision * precision;
......
......@@ -66,7 +66,7 @@ THREE.Mesh.prototype.raycast = ( function () {
var vB = new THREE.Vector3();
var vC = new THREE.Vector3();
return function ( raycaster, intersects ) {
return function raycast ( raycaster, intersects ) {
var geometry = this.geometry;
var material = this.material;
......
......@@ -21,7 +21,7 @@ THREE.PointCloud.prototype.raycast = ( function () {
var inverseMatrix = new THREE.Matrix4();
var ray = new THREE.Ray();
return function ( raycaster, intersects ) {
return function raycast ( raycaster, intersects ) {
var object = this;
var geometry = object.geometry;
......
......@@ -145,7 +145,7 @@ THREE.Skeleton.prototype.update = ( function () {
var offsetMatrix = new THREE.Matrix4();
return function () {
return function update ( ) {
// flatten bone matrices to array
......
......@@ -14,7 +14,7 @@ THREE.Sprite = ( function () {
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
return function ( material ) {
return function Sprite ( material ) {
THREE.Object3D.call( this );
......@@ -34,7 +34,7 @@ THREE.Sprite.prototype.raycast = ( function () {
var matrixPosition = new THREE.Vector3();
return function ( raycaster, intersects ) {
return function raycast ( raycaster, intersects ) {
matrixPosition.setFromMatrixPosition( this.matrixWorld );
......
......@@ -312,7 +312,7 @@ THREE.WebGLRenderer = function ( parameters ) {
var array;
return function () {
return function getCompressedTextureFormats ( ) {
if ( array !== undefined ) {
......@@ -439,7 +439,7 @@ THREE.WebGLRenderer = function ( parameters ) {
var value;
return function () {
return function getMaxAnisotropy() {
if ( value !== undefined ) return value;
......
......@@ -76,7 +76,7 @@ THREE.WebGLProgram = ( function () {
}
return function ( renderer, code, material, parameters ) {
return function WebGLProgram ( renderer, code, material, parameters ) {
var gl = renderer.context;
......
......@@ -14,7 +14,7 @@ THREE.WebGLShader = ( function () {
};
return function ( gl, type, string ) {
return function WebGLShader ( gl, type, string ) {
var shader = gl.createShader( type );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册