Skip to content

Commit 83b394e

Browse files
authored
Merge pull request #14785 from Mugen87/dev2
Examples: Removed unused variables
2 parents 3830394 + 34e3dac commit 83b394e

26 files changed

+43
-109
lines changed

examples/canvas_lines.html

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,14 @@
3030
windowHalfX = window.innerWidth / 2,
3131
windowHalfY = window.innerHeight / 2,
3232

33-
SEPARATION = 200,
34-
AMOUNTX = 10,
35-
AMOUNTY = 10,
36-
3733
camera, scene, renderer;
3834

3935
init();
4036
animate();
4137

4238
function init() {
4339

44-
var container, separation = 100, amountX = 50, amountY = 50,
45-
particles, particle;
46-
47-
container = document.createElement('div');
40+
var container = document.createElement('div');
4841
document.body.appendChild(container);
4942

5043
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
@@ -77,7 +70,7 @@
7770

7871
for ( var i = 0; i < 100; i ++ ) {
7972

80-
particle = new THREE.Sprite( material );
73+
var particle = new THREE.Sprite( material );
8174
particle.position.x = Math.random() * 2 - 1;
8275
particle.position.y = Math.random() * 2 - 1;
8376
particle.position.z = Math.random() * 2 - 1;

examples/canvas_materials_normal.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646

4747
<script>
4848

49-
var camera, scene, renderer,
50-
loader, mesh;
49+
var camera, scene, renderer, mesh;
5150

5251
init();
5352
animate();
@@ -61,7 +60,7 @@
6160

6261
scene = new THREE.Scene();
6362

64-
loader = new THREE.BufferGeometryLoader();
63+
var loader = new THREE.BufferGeometryLoader();
6564
loader.load( 'models/json/WaltHeadLo_buffergeometry.json', function ( geometry ) {
6665

6766
mesh = new THREE.Mesh( geometry, new THREE.MeshNormalMaterial( { overdraw: 0.5 } ) );
@@ -100,8 +99,6 @@
10099

101100
function render() {
102101

103-
var time = Date.now() * 0.0005;
104-
105102
if ( mesh ) {
106103

107104
mesh.rotation.x -= 0.005;

examples/canvas_materials_reflection.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@
105105

106106
function render() {
107107

108-
var time = Date.now() * 0.0005;
109-
110108
if ( mesh ) mesh.rotation.y -= 0.01;
111109

112110
renderer.render( scene, camera );

examples/js/MD2Character.js

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ THREE.MD2Character = function () {
4242

4343
var loader = new THREE.MD2Loader();
4444

45-
loader.load( config.baseUrl + config.body, function( geo ) {
45+
loader.load( config.baseUrl + config.body, function ( geo ) {
4646

4747
geo.computeBoundingBox();
4848
scope.root.position.y = - scope.scale * geo.boundingBox.min.y;
@@ -55,7 +55,7 @@ THREE.MD2Character = function () {
5555
scope.meshBody = mesh;
5656

5757
scope.meshBody.clipOffset = 0;
58-
scope.activeAnimationClipName = mesh.geometry.animations[0].name;
58+
scope.activeAnimationClipName = mesh.geometry.animations[ 0 ].name;
5959

6060
scope.mixer = new THREE.AnimationMixer( mesh );
6161

@@ -67,7 +67,7 @@ THREE.MD2Character = function () {
6767

6868
var generateCallback = function ( index, name ) {
6969

70-
return function( geo ) {
70+
return function ( geo ) {
7171

7272
var mesh = createPart( geo, scope.skinsWeapon[ index ] );
7373
mesh.scale.set( scope.scale, scope.scale, scope.scale );
@@ -82,7 +82,7 @@ THREE.MD2Character = function () {
8282

8383
checkLoadingComplete();
8484

85-
}
85+
};
8686

8787
};
8888

@@ -96,11 +96,14 @@ THREE.MD2Character = function () {
9696

9797
this.setPlaybackRate = function ( rate ) {
9898

99-
if( rate !== 0 ) {
99+
if ( rate !== 0 ) {
100+
100101
this.mixer.timeScale = 1 / rate;
101-
}
102-
else {
102+
103+
} else {
104+
103105
this.mixer.timeScale = 0;
106+
104107
}
105108

106109
};
@@ -121,7 +124,7 @@ THREE.MD2Character = function () {
121124

122125
};
123126

124-
this.setSkin = function( index ) {
127+
this.setSkin = function ( index ) {
125128

126129
if ( this.meshBody && this.meshBody.material.wireframe === false ) {
127130

@@ -152,13 +155,16 @@ THREE.MD2Character = function () {
152155

153156
if ( this.meshBody ) {
154157

155-
if( this.meshBody.activeAction ) {
158+
if ( this.meshBody.activeAction ) {
159+
156160
this.meshBody.activeAction.stop();
157161
this.meshBody.activeAction = null;
162+
158163
}
159164

160165
var action = this.mixer.clipAction( clipName, this.meshBody );
161-
if( action ) {
166+
167+
if ( action ) {
162168

163169
this.meshBody.activeAction = action.play();
164170

@@ -172,35 +178,34 @@ THREE.MD2Character = function () {
172178

173179
};
174180

175-
this.syncWeaponAnimation = function() {
181+
this.syncWeaponAnimation = function () {
176182

177183
var clipName = scope.activeClipName;
178184

179185
if ( scope.meshWeapon ) {
180186

181-
if( this.meshWeapon.activeAction ) {
187+
if ( this.meshWeapon.activeAction ) {
188+
182189
this.meshWeapon.activeAction.stop();
183190
this.meshWeapon.activeAction = null;
184-
}
185191

186-
var geometry = this.meshWeapon.geometry,
187-
animations = geometry.animations;
192+
}
188193

189194
var action = this.mixer.clipAction( clipName, this.meshWeapon );
190-
if( action ) {
191195

192-
this.meshWeapon.activeAction =
193-
action.syncWith( this.meshBody.activeAction ).play();
196+
if ( action ) {
197+
198+
this.meshWeapon.activeAction = action.syncWith( this.meshBody.activeAction ).play();
194199

195200
}
196201

197202
}
198203

199-
}
204+
};
200205

201206
this.update = function ( delta ) {
202207

203-
if( this.mixer ) this.mixer.update( delta );
208+
if ( this.mixer ) this.mixer.update( delta );
204209

205210
};
206211

examples/webgl_animation_cloth.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@
104104

105105
// lights
106106

107-
var light, materials;
108-
109107
scene.add( new THREE.AmbientLight( 0x666666 ) );
110108

111-
light = new THREE.DirectionalLight( 0xdfebff, 1 );
109+
var light = new THREE.DirectionalLight( 0xdfebff, 1 );
112110
light.position.set( 50, 200, 100 );
113111
light.position.multiplyScalar( 1.3 );
114112

examples/webgl_animation_skinning_morph.html

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -181,37 +181,18 @@
181181

182182
function createScene( geometry, materials, x, y, z, s ) {
183183

184-
//ensureLoop( geometry.animation );
185-
186184
geometry.computeBoundingBox();
187185
var bb = geometry.boundingBox;
188186

189-
var path = "textures/cube/Park2/";
190-
var format = '.jpg';
191-
var urls = [
192-
path + 'posx' + format, path + 'negx' + format,
193-
path + 'posy' + format, path + 'negy' + format,
194-
path + 'posz' + format, path + 'negz' + format
195-
];
196-
197187
for ( var i = 0; i < materials.length; i ++ ) {
198188

199189
var m = materials[ i ];
200190
m.skinning = true;
201191
m.morphTargets = true;
202192

203193
m.specular.setHSL( 0, 0, 0.1 );
204-
205194
m.color.setHSL( 0.6, 0, 0.6 );
206195

207-
//m.map = map;
208-
//m.envMap = envMap;
209-
//m.bumpMap = bumpMap;
210-
//m.bumpScale = 2;
211-
212-
//m.combine = THREE.MixOperation;
213-
//m.reflectivity = 0.75;
214-
215196
}
216197

217198
mesh = new THREE.SkinnedMesh( geometry, materials );

examples/webgl_camera_logarithmicdepthbuffer.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@
193193
emissive: 0x000000
194194
};
195195

196-
var meshes = [];
197-
198196
var geometry = new THREE.SphereBufferGeometry(0.5, 24, 12);
199197

200198
for (var i = 0; i < labeldata.length; i++) {

examples/webgl_geometry_terrain.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@
152152

153153
function generateTexture( data, width, height ) {
154154

155-
var canvas, canvasScaled, context, image, imageData,
156-
level, diff, vector3, sun, shade;
155+
var canvas, canvasScaled, context, image, imageData, vector3, sun, shade;
157156

158157
vector3 = new THREE.Vector3( 0, 0, 0 );
159158

examples/webgl_geometry_terrain_fog.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@
155155

156156
function generateTexture( data, width, height ) {
157157

158-
var canvas, canvasScaled, context, image, imageData,
159-
level, diff, vector3, sun, shade;
158+
var canvas, canvasScaled, context, image, imageData, vector3, sun, shade;
160159

161160
vector3 = new THREE.Vector3( 0, 0, 0 );
162161

examples/webgl_geometry_terrain_raycast.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@
168168

169169
// bake lighting into texture
170170

171-
var canvas, canvasScaled, context, image, imageData,
172-
level, diff, vector3, sun, shade;
171+
var canvas, canvasScaled, context, image, imageData, vector3, sun, shade;
173172

174173
vector3 = new THREE.Vector3( 0, 0, 0 );
175174

0 commit comments

Comments
 (0)