Skip to content

Commit

Permalink
Merge pull request #10140 from TristanVALCKE/example_warning_fix
Browse files Browse the repository at this point in the history
Example warning fix
  • Loading branch information
mrdoob committed Nov 16, 2016
2 parents cf16452 + 62e9cf5 commit e8ad809
Show file tree
Hide file tree
Showing 140 changed files with 422 additions and 439 deletions.
2 changes: 1 addition & 1 deletion examples/css3d_molecules.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@

}

colorSprite = colorSpriteMap[ element ];
var colorSprite = colorSpriteMap[ element ];

var atom = document.createElement( 'img' );
atom.src = colorSprite;
Expand Down
6 changes: 3 additions & 3 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1>
<script>

function extractQuery() {
var p = window.location.search.indexOf( '?q=' )
var p = window.location.search.indexOf( '?q=' );
if( p !== -1 ) {
return window.location.search.substr( 3 );
}
Expand Down Expand Up @@ -383,7 +383,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1>
} else {
window.history.replaceState( {} , '', window.location.pathname );
}
if( selected ) window.location.hash = selected
if( selected ) window.location.hash = selected;

var exp = new RegExp( v, 'gi' );

Expand Down Expand Up @@ -473,7 +473,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1>

}

filterInput.value = extractQuery()
filterInput.value = extractQuery();
updateFilter( )

</script>
Expand Down
5 changes: 2 additions & 3 deletions examples/js/BlendCharacter.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ THREE.BlendCharacter = function () {
scope.material.skinning = true;

scope.mixer = new THREE.AnimationMixer( scope );
scope.mixer = scope.mixer;

// Create the animations
for ( var i = 0; i < scope.geometry.animations.length; ++ i ) {
Expand Down Expand Up @@ -129,7 +128,7 @@ THREE.BlendCharacter = function () {

return this.mixer.clipAction( animName ).getEffectiveWeight();

}
};

this.pauseAll = function() {

Expand All @@ -154,7 +153,7 @@ THREE.BlendCharacter = function () {

this.visible = boolean;

}
};

};

Expand Down
6 changes: 3 additions & 3 deletions examples/js/Encodings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

THREE.Encodings = function() {
if( THREE.toHalf === undefined ) throw new Error("THREE.Encodings is required for HDRCubeMapLoader when loading half data.");
}
};

THREE.Encodings.RGBEByteToRGBFloat = function( sourceArray, sourceOffset, destArray, destOffset ) {
var e = sourceArray[sourceOffset+3];
Expand All @@ -14,7 +14,7 @@ THREE.Encodings.RGBEByteToRGBFloat = function( sourceArray, sourceOffset, destAr
destArray[destOffset+0] = sourceArray[sourceOffset+0] * scale;
destArray[destOffset+1] = sourceArray[sourceOffset+1] * scale;
destArray[destOffset+2] = sourceArray[sourceOffset+2] * scale;
}
};

THREE.Encodings.RGBEByteToRGBHalf = function( sourceArray, sourceOffset, destArray, destOffset ) {
var e = sourceArray[sourceOffset+3];
Expand All @@ -23,4 +23,4 @@ THREE.Encodings.RGBEByteToRGBHalf = function( sourceArray, sourceOffset, destArr
destArray[destOffset+0] = THREE.toHalf( sourceArray[sourceOffset+0] * scale );
destArray[destOffset+1] = THREE.toHalf( sourceArray[sourceOffset+1] * scale );
destArray[destOffset+2] = THREE.toHalf( sourceArray[sourceOffset+2] * scale );
}
};
6 changes: 3 additions & 3 deletions examples/js/GPUComputationRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) {

materialShader.defines.resolution = 'vec2( ' + sizeX.toFixed( 1 ) + ', ' + sizeY.toFixed( 1 ) + " )";

};
}
this.addResolutionDefine = addResolutionDefine;


Expand All @@ -277,7 +277,7 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) {
addResolutionDefine( material );

return material;
};
}
this.createShaderMaterial = createShaderMaterial;

this.createRenderTarget = function( sizeXTexture, sizeYTexture, wrapS, wrapT, minFilter, magFilter ) {
Expand Down Expand Up @@ -367,4 +367,4 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) {

}

}
}
35 changes: 18 additions & 17 deletions examples/js/GPUParticleSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ THREE.GPUParticleSystem = function(options) {

self.random = function() {
return ++i >= self.rand.length ? self.rand[i = 1] : self.rand[i];
}
};

var textureLoader = new THREE.TextureLoader();

Expand Down Expand Up @@ -252,7 +252,7 @@ THREE.GPUParticleSystem = function(options) {

}

}
};

this.spawnParticle = function(options) {

Expand All @@ -265,7 +265,7 @@ THREE.GPUParticleSystem = function(options) {

currentContainer.spawnParticle(options);

}
};

this.update = function(time) {
for (var i = 0; i < self.PARTICLE_CONTAINERS; i++) {
Expand All @@ -277,7 +277,7 @@ THREE.GPUParticleSystem = function(options) {

this.init();

}
};

THREE.GPUParticleSystem.prototype = Object.create(THREE.Object3D.prototype);
THREE.GPUParticleSystem.prototype.constructor = THREE.GPUParticleSystem;
Expand All @@ -299,14 +299,14 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
THREE.Object3D.apply(this, arguments);

// construct a couple small arrays used for packing variables into floats etc
var UINT8_VIEW = new Uint8Array(4)
var FLOAT_VIEW = new Float32Array(UINT8_VIEW.buffer)
var UINT8_VIEW = new Uint8Array(4);
var FLOAT_VIEW = new Float32Array(UINT8_VIEW.buffer);

function decodeFloat(x, y, z, w) {
UINT8_VIEW[0] = Math.floor(w)
UINT8_VIEW[1] = Math.floor(z)
UINT8_VIEW[2] = Math.floor(y)
UINT8_VIEW[3] = Math.floor(x)
UINT8_VIEW[0] = Math.floor(w);
UINT8_VIEW[1] = Math.floor(z);
UINT8_VIEW[2] = Math.floor(y);
UINT8_VIEW[3] = Math.floor(x);
return FLOAT_VIEW[0]
}

Expand All @@ -329,7 +329,7 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
if (b > 0) b--;

return [r, g, b];
};
}

self.particles = [];
self.deadParticles = [];
Expand Down Expand Up @@ -366,7 +366,7 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
self.particleShaderGeo.addAttribute('particlePositionsStartTime', new THREE.BufferAttribute(self.particlePositionsStartTime, 4).setDynamic(true));
self.particleShaderGeo.addAttribute('particleVelColSizeLife', new THREE.BufferAttribute(self.particleVelColSizeLife, 4).setDynamic(true));

self.posStart = self.particleShaderGeo.getAttribute('particlePositionsStartTime')
self.posStart = self.particleShaderGeo.getAttribute('particlePositionsStartTime');
self.velCol = self.particleShaderGeo.getAttribute('particleVelColSizeLife');

self.particleShaderMat = self.GPUParticleSystem.particleShaderMat;
Expand All @@ -388,6 +388,7 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
lifetime = 0.,
size = 0.,
sizeRandomness = 0.,
smoothPosition = false,
i;

var maxVel = 2;
Expand All @@ -409,8 +410,8 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
turbulence = options.turbulence !== undefined ? options.turbulence : 1.0;
lifetime = options.lifetime !== undefined ? options.lifetime : 5.0;
size = options.size !== undefined ? options.size : 10;
sizeRandomness = options.sizeRandomness !== undefined ? options.sizeRandomness : 0.0,
smoothPosition = options.smoothPosition !== undefined ? options.smoothPosition : false;
sizeRandomness = options.sizeRandomness !== undefined ? options.sizeRandomness : 0.0;
smoothPosition = options.smoothPosition !== undefined ? options.smoothPosition : false;

if (self.DPR !== undefined) size *= self.DPR;

Expand Down Expand Up @@ -467,7 +468,7 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {

self.particleUpdate = true;

}
};

this.update = function(time) {

Expand Down Expand Up @@ -497,11 +498,11 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
self.offset = 0;
self.count = 0;
}
}
};

this.init();

}
};

THREE.GPUParticleContainer.prototype = Object.create(THREE.Object3D.prototype);
THREE.GPUParticleContainer.prototype.constructor = THREE.GPUParticleContainer;
6 changes: 3 additions & 3 deletions examples/js/MarchingCubes.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ THREE.MarchingCubes = function ( resolution, material, enableUvs, enableColors )

}

};
}

this.begin = function () {

Expand Down Expand Up @@ -493,8 +493,8 @@ THREE.MarchingCubes = function ( resolution, material, enableUvs, enableColors )

for ( z = min_z; z < max_z; z ++ ) {

z_offset = this.size2 * z,
fz = z / this.size - ballz,
z_offset = this.size2 * z;
fz = z / this.size - ballz;
fz2 = fz * fz;

for ( y = min_y; y < max_y; y ++ ) {
Expand Down
6 changes: 3 additions & 3 deletions examples/js/Ocean.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
this.geometrySize = optionalParameter( options.GEOMETRY_SIZE, 2000 );
this.resolution = optionalParameter( options.RESOLUTION, 64 );
this.floatSize = optionalParameter( options.SIZE_OF_FLOAT, 4 );
this.windX = optionalParameter( options.INITIAL_WIND[ 0 ], 10.0 ),
this.windY = optionalParameter( options.INITIAL_WIND[ 1 ], 10.0 ),
this.size = optionalParameter( options.INITIAL_SIZE, 250.0 ),
this.windX = optionalParameter( options.INITIAL_WIND[ 0 ], 10.0 );
this.windY = optionalParameter( options.INITIAL_WIND[ 1 ], 10.0 );
this.size = optionalParameter( options.INITIAL_SIZE, 250.0 );
this.choppiness = optionalParameter( options.INITIAL_CHOPPINESS, 1.5 );

//
Expand Down
8 changes: 4 additions & 4 deletions examples/js/RollerCoaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,19 @@ var RollerCoasterLiftersGeometry = function ( curve, size ) {
var point1 = shape[ j ];
var point2 = shape[ ( j + 1 ) % jl ];

vector1.copy( point1 )
vector1.copy( point1 );
vector1.applyQuaternion( quaternion );
vector1.add( fromPoint );

vector2.copy( point2 )
vector2.copy( point2 );
vector2.applyQuaternion( quaternion );
vector2.add( fromPoint );

vector3.copy( point2 )
vector3.copy( point2 );
vector3.applyQuaternion( quaternion );
vector3.add( toPoint );

vector4.copy( point1 )
vector4.copy( point1 );
vector4.applyQuaternion( quaternion );
vector4.add( toPoint );

Expand Down
4 changes: 2 additions & 2 deletions examples/js/SkyShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ THREE.ShaderLib[ 'sky' ] = {
// mie coefficients
"vBetaM = totalMie(lambda, turbidity) * mieCoefficient;",

"}",
"}"

].join( "\n" ),

Expand Down Expand Up @@ -201,7 +201,7 @@ THREE.ShaderLib[ 'sky' ] = {
"gl_FragColor.rgb = retColor;",

"gl_FragColor.a = 1.0;",
"}",
"}"

].join( "\n" )

Expand Down
4 changes: 2 additions & 2 deletions examples/js/UCSCharacter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ THREE.UCSCharacter = function() {

this.root = new THREE.Object3D();

this.numSkins;
this.numMorphs;
this.numSkins = undefined;
this.numMorphs = undefined;

this.skins = [];
this.materials = [];
Expand Down
5 changes: 2 additions & 3 deletions examples/js/Volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ THREE.Volume = function( xLength, yLength, zLength, type, arrayBuffer ) {
case 'uint32' :
case 'uint' :
case 'unsigned int' :
case 'uint32' :
case 'uint32_t' :
this.data = new Uint32Array( arrayBuffer );
break;
Expand Down Expand Up @@ -188,7 +187,7 @@ THREE.Volume = function( xLength, yLength, zLength, type, arrayBuffer ) {
* @member {Array} RASDimensions This array holds the dimensions of the volume in the RAS space
*/

}
};

THREE.Volume.prototype = {

Expand Down Expand Up @@ -445,4 +444,4 @@ THREE.Volume.prototype = {

}

}
};
4 changes: 2 additions & 2 deletions examples/js/VolumeSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ THREE.VolumeSlice = function( volume, index, axis ) {
*/


}
};

THREE.VolumeSlice.prototype = {

Expand Down Expand Up @@ -214,4 +214,4 @@ THREE.VolumeSlice.prototype = {

}

}
};
6 changes: 3 additions & 3 deletions examples/js/animation/MMDPhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ THREE.MMDPhysics.ResourceHelper.prototype = {
q.setW( w );
return q;

},
}

};

Expand Down Expand Up @@ -678,7 +678,7 @@ THREE.MMDPhysics.RigidBody.prototype = {

}

};
}

var helper = this.helper;
var params = this.params;
Expand Down Expand Up @@ -871,7 +871,7 @@ THREE.MMDPhysics.RigidBody.prototype = {

thQ.set( q.x(), q.y(), q.z(), q.w() );
thQ2.setFromRotationMatrix( this.bone.matrixWorld );
thQ2.conjugate()
thQ2.conjugate();
thQ2.multiply( thQ );

//this.bone.quaternion.multiply( thQ2 );
Expand Down
2 changes: 1 addition & 1 deletion examples/js/controls/DragControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {

}

}
};
6 changes: 3 additions & 3 deletions examples/js/controls/EditorControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ THREE.EditorControls = function ( object, domElement ) {

this.enabled = true;
this.center = new THREE.Vector3();
this.panSpeed = 0.001
this.zoomSpeed = 0.001
this.rotationSpeed = 0.005
this.panSpeed = 0.001;
this.zoomSpeed = 0.001;
this.rotationSpeed = 0.005;

// internals

Expand Down

0 comments on commit e8ad809

Please sign in to comment.