Three.Legacy.js 35.7 KB
Newer Older
M
Mr.doob 已提交
1 2 3 4
/**
 * @author mrdoob / http://mrdoob.com/
 */

5 6 7 8
import { Audio } from './audio/Audio.js';
import { AudioAnalyser } from './audio/AudioAnalyser.js';
import { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
import { CullFaceFront, CullFaceBack } from './constants.js';
9 10 11 12 13 14 15 16 17 18 19 20
import {
	Float64BufferAttribute,
	Float32BufferAttribute,
	Uint32BufferAttribute,
	Int32BufferAttribute,
	Uint16BufferAttribute,
	Int16BufferAttribute,
	Uint8ClampedBufferAttribute,
	Uint8BufferAttribute,
	Int8BufferAttribute,
	BufferAttribute
} from './core/BufferAttribute.js';
21 22
import { BufferGeometry } from './core/BufferGeometry.js';
import { Face3 } from './core/Face3.js';
L
looeee 已提交
23
import { Geometry } from './core/Geometry';
24
import { Object3D } from './core/Object3D.js';
25
import { Uniform } from './core/Uniform';
26
import { Curve } from './extras/core/Curve.js';
L
looeee 已提交
27
import { CatmullRomCurve3 } from './extras/curves/CatmullRomCurve3.js';
M
Mr.doob 已提交
28 29
import { BoxHelper } from './helpers/BoxHelper';
import { GridHelper } from './helpers/GridHelper.js';
30
import { BoxGeometry } from './geometries/BoxGeometry.js';
31
import { EdgesGeometry } from './geometries/EdgesGeometry.js';
32 33
import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js';
import { ShapeGeometry } from './geometries/ShapeGeometry.js';
34
import { WireframeGeometry } from './geometries/WireframeGeometry.js';
35
import { Light } from './lights/Light.js';
M
Mr.doob 已提交
36
import { FileLoader } from './loaders/FileLoader.js';
37 38
import { AudioLoader } from './loaders/AudioLoader.js';
import { CubeTextureLoader } from './loaders/CubeTextureLoader.js';
L
Lewy Blue 已提交
39
import { DataTextureLoader } from './loaders/DataTextureLoader.js';
40 41
import { TextureLoader } from './loaders/TextureLoader.js';
import { Material } from './materials/Material.js';
42
import { LineBasicMaterial } from './materials/LineBasicMaterial.js';
43 44 45 46 47 48 49
import { MeshPhongMaterial } from './materials/MeshPhongMaterial.js';
import { MultiMaterial } from './materials/MultiMaterial.js';
import { PointsMaterial } from './materials/PointsMaterial.js';
import { ShaderMaterial } from './materials/ShaderMaterial.js';
import { Box2 } from './math/Box2.js';
import { Box3 } from './math/Box3.js';
import { Color } from './math/Color.js';
50
import { Line3 } from './math/Line3.js';
L
looeee 已提交
51
import { _Math } from './math/Math.js';
52 53 54 55 56
import { Matrix3 } from './math/Matrix3.js';
import { Matrix4 } from './math/Matrix4.js';
import { Plane } from './math/Plane.js';
import { Quaternion } from './math/Quaternion.js';
import { Ray } from './math/Ray.js';
57
import { Vector2 } from './math/Vector2.js';
58
import { Vector3 } from './math/Vector3.js';
59
import { Vector4 } from './math/Vector4.js';
60
import { LineSegments } from './objects/LineSegments.js';
61 62 63 64 65 66
import { LOD } from './objects/LOD.js';
import { Points } from './objects/Points.js';
import { Sprite } from './objects/Sprite.js';
import { WebGLRenderer } from './renderers/WebGLRenderer.js';
import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
import { WebGLShadowMap } from './renderers/webgl/WebGLShadowMap.js';
67
import { Shape } from './extras/core/Shape.js';
68 69 70

export { BoxGeometry as CubeGeometry };

71 72
export function Face4( a, b, c, d, normal, color, materialIndex ) {

73 74
	console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' );
	return new Face3( a, b, c, normal, color, materialIndex );
75

76 77
}

M
Mr.doob 已提交
78
export var LineStrip = 0;
79

M
Mr.doob 已提交
80
export var LinePieces = 1;
81

82 83 84 85 86 87 88 89
export function MeshFaceMaterial( materials ) {

	console.warn( 'THREE.MeshFaceMaterial has been renamed to THREE.MultiMaterial.' );
	return new MultiMaterial( materials );

}

export function PointCloud( geometry, material ) {
90 91 92

	console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' );
	return new Points( geometry, material );
93 94 95 96 97

}

export function Particle( material ) {

M
Mr.doob 已提交
98
	console.warn( 'THREE.Particle has been renamed to THREE.Sprite.' );
99 100
	return new Sprite( material );

101 102
}

103
export function ParticleSystem( geometry, material ) {
104 105 106

	console.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' );
	return new Points( geometry, material );
107

108 109
}

110 111
export function PointCloudMaterial( parameters ) {

112 113
	console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' );
	return new PointsMaterial( parameters );
114

115 116
}

117 118
export function ParticleBasicMaterial( parameters ) {

119 120
	console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' );
	return new PointsMaterial( parameters );
121

122 123
}

124 125
export function ParticleSystemMaterial( parameters ) {

126 127
	console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' );
	return new PointsMaterial( parameters );
128

129 130
}

131 132
export function Vertex( x, y, z ) {

133 134
	console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' );
	return new Vector3( x, y, z );
135

136
}
M
Mr.doob 已提交
137 138 139

//

140
export function DynamicBufferAttribute( array, itemSize ) {
141

142 143
	console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.' );
	return new BufferAttribute( array, itemSize ).setDynamic( true );
144

145 146 147
}

export function Int8Attribute( array, itemSize ) {
148

149 150
	console.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.' );
	return new Int8BufferAttribute( array, itemSize );
151

152 153 154
}

export function Uint8Attribute( array, itemSize ) {
155

156 157
	console.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.' );
	return new Uint8BufferAttribute( array, itemSize );
158

159 160 161
}

export function Uint8ClampedAttribute( array, itemSize ) {
162

163 164
	console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.' );
	return new Uint8ClampedBufferAttribute( array, itemSize );
165

166 167 168
}

export function Int16Attribute( array, itemSize ) {
169

170 171
	console.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.' );
	return new Int16BufferAttribute( array, itemSize );
172

173 174 175
}

export function Uint16Attribute( array, itemSize ) {
176

177 178
	console.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.' );
	return new Uint16BufferAttribute( array, itemSize );
179

180 181 182
}

export function Int32Attribute( array, itemSize ) {
183

184 185
	console.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.' );
	return new Int32BufferAttribute( array, itemSize );
186

187 188 189
}

export function Uint32Attribute( array, itemSize ) {
190

191 192
	console.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.' );
	return new Uint32BufferAttribute( array, itemSize );
193

194 195 196
}

export function Float32Attribute( array, itemSize ) {
197

198 199
	console.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.' );
	return new Float32BufferAttribute( array, itemSize );
200

201 202 203
}

export function Float64Attribute( array, itemSize ) {
204

205 206
	console.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.' );
	return new Float64BufferAttribute( array, itemSize );
207

208 209 210 211
}

//

212 213 214 215 216 217 218 219 220 221 222 223 224 225
Curve.create = function ( construct, getPoint ) {

	console.log( 'THREE.Curve.create() has been deprecated' );

	construct.prototype = Object.create( Curve.prototype );
	construct.prototype.constructor = construct;
	construct.prototype.getPoint = getPoint;

	return construct;

};

//

L
looeee 已提交
226
export function ClosedSplineCurve3( points ) {
L
looeee 已提交
227

M
Mr.doob 已提交
228
	console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' );
L
looeee 已提交
229 230 231 232 233 234 235 236 237

	CatmullRomCurve3.call( this, points );
	this.type = 'catmullrom';
	this.closed = true;

}

ClosedSplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype );

M
Mugen87 已提交
238 239 240 241
//

export function SplineCurve3( points ) {

M
Mugen87 已提交
242
	console.warn( 'THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' );
M
Mugen87 已提交
243 244 245 246 247 248 249

	CatmullRomCurve3.call( this, points );
	this.type = 'catmullrom';

}

SplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype );
L
looeee 已提交
250

M
Mugen87 已提交
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
//

export function Spline( points ) {

	console.warn( 'THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.' );

	CatmullRomCurve3.call( this, points );
	this.type = 'catmullrom';

}

Spline.prototype = Object.create( CatmullRomCurve3.prototype );

Object.assign( Spline.prototype, {

	initFromArray: function ( a ) {

268
		console.error( 'THREE.Spline: .initFromArray() has been removed.' );
M
Mugen87 已提交
269 270 271 272

	},
	getControlPointsArray: function ( optionalTarget ) {

273
		console.error( 'THREE.Spline: .getControlPointsArray() has been removed.' );
M
Mugen87 已提交
274 275 276 277

	},
	reparametrizeByArcLength: function ( samplingCoef ) {

278
		console.error( 'THREE.Spline: .reparametrizeByArcLength() has been removed.' );
M
Mugen87 已提交
279 280 281 282 283

	}

} );

L
looeee 已提交
284
//
M
Mr.doob 已提交
285 286
export function BoundingBoxHelper( object, color ) {

L
looeee 已提交
287 288 289
	console.warn( 'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.' );
	return new BoxHelper( object, color );

M
Mr.doob 已提交
290
}
L
looeee 已提交
291

292
export function EdgesHelper( object, hex ) {
293

294 295
	console.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' );
	return new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );
296

297 298
}

M
Mr.doob 已提交
299
GridHelper.prototype.setColors = function () {
300

M
Mr.doob 已提交
301
	console.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' );
302

M
Mr.doob 已提交
303
};
L
looeee 已提交
304

305
export function WireframeHelper( object, hex ) {
306

307 308
	console.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' );
	return new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );
309

310 311 312 313
}

//

M
Mr.doob 已提交
314
export function XHRLoader( manager ) {
315

M
Mr.doob 已提交
316 317
	console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' );
	return new FileLoader( manager );
318

M
Mr.doob 已提交
319 320
}

L
Lewy Blue 已提交
321 322 323 324 325 326 327
export function BinaryTextureLoader( manager ) {

	console.warn( 'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.' );
	return new DataTextureLoader( manager );

}

M
Mr.doob 已提交
328 329
//

330
Object.assign( Box2.prototype, {
331

332
	center: function ( optionalTarget ) {
333

334 335
		console.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' );
		return this.getCenter( optionalTarget );
336

337
	},
M
Mr.doob 已提交
338
	empty: function () {
339

M
Mr.doob 已提交
340 341
		console.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' );
		return this.isEmpty();
342

343
	},
M
Mr.doob 已提交
344
	isIntersectionBox: function ( box ) {
345

M
Mr.doob 已提交
346 347
		console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' );
		return this.intersectsBox( box );
348

349 350
	},
	size: function ( optionalTarget ) {
351

352 353
		console.warn( 'THREE.Box2: .size() has been renamed to .getSize().' );
		return this.getSize( optionalTarget );
354

M
Mr.doob 已提交
355 356 357
	}
} );

358
Object.assign( Box3.prototype, {
359

360
	center: function ( optionalTarget ) {
361

362 363
		console.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' );
		return this.getCenter( optionalTarget );
364

365
	},
M
Mr.doob 已提交
366
	empty: function () {
367

M
Mr.doob 已提交
368 369
		console.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' );
		return this.isEmpty();
370

371
	},
M
Mr.doob 已提交
372
	isIntersectionBox: function ( box ) {
373

M
Mr.doob 已提交
374 375
		console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' );
		return this.intersectsBox( box );
376

M
Mr.doob 已提交
377
	},
M
Mr.doob 已提交
378
	isIntersectionSphere: function ( sphere ) {
379

M
Mr.doob 已提交
380 381
		console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
		return this.intersectsSphere( sphere );
382

383 384
	},
	size: function ( optionalTarget ) {
385

386 387
		console.warn( 'THREE.Box3: .size() has been renamed to .getSize().' );
		return this.getSize( optionalTarget );
388

M
Mr.doob 已提交
389 390 391
	}
} );

M
Mr.doob 已提交
392
Line3.prototype.center = function ( optionalTarget ) {
393

M
Mr.doob 已提交
394 395
	console.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' );
	return this.getCenter( optionalTarget );
396

M
Mr.doob 已提交
397
};
398

M
Mr.doob 已提交
399
_Math.random16 = function () {
400

M
Mr.doob 已提交
401 402
	console.warn( 'THREE.Math.random16() has been deprecated. Use Math.random() instead.' );
	return Math.random();
403

M
Mr.doob 已提交
404
};
L
looeee 已提交
405

406
Object.assign( Matrix3.prototype, {
M
Mr.doob 已提交
407

408
	flattenToArrayOffset: function ( array, offset ) {
409

410 411
		console.warn( "THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." );
		return this.toArray( array, offset );
412

413
	},
M
Mr.doob 已提交
414
	multiplyVector3: function ( vector ) {
415

M
Mr.doob 已提交
416 417
		console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' );
		return vector.applyMatrix3( this );
418

M
Mr.doob 已提交
419
	},
M
Mr.doob 已提交
420
	multiplyVector3Array: function ( a ) {
421

M
Mr.doob 已提交
422 423
		console.warn( 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );
		return this.applyToVector3Array( a );
424

425 426 427
	},
	applyToBuffer: function( buffer, offset, length ) {

428 429
		console.warn( 'THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' );
		return this.applyToBufferAttribute( buffer );
430

431 432 433 434 435
	},
	applyToVector3Array: function( array, offset, length ) {

		console.error( 'THREE.Matrix3: .applyToVector3Array() has been removed.' );

M
Mr.doob 已提交
436
	}
M
Mr.doob 已提交
437

M
Mr.doob 已提交
438 439
} );

440
Object.assign( Matrix4.prototype, {
M
Mr.doob 已提交
441

M
Mr.doob 已提交
442
	extractPosition: function ( m ) {
443

M
Mr.doob 已提交
444 445
		console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' );
		return this.copyPosition( m );
446

M
Mr.doob 已提交
447
	},
448 449
	flattenToArrayOffset: function ( array, offset ) {

450
		console.warn( "THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." );
451
		return this.toArray( array, offset );
452

453
	},
L
looeee 已提交
454 455 456 457 458
	getPosition: function () {

		var v1;

		return function getPosition() {
459

L
looeee 已提交
460 461 462
			if ( v1 === undefined ) v1 = new Vector3();
			console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' );
			return v1.setFromMatrixColumn( this, 3 );
463

L
looeee 已提交
464 465 466
		};

	}(),
M
Mr.doob 已提交
467
	setRotationFromQuaternion: function ( q ) {
468

M
Mr.doob 已提交
469 470
		console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );
		return this.makeRotationFromQuaternion( q );
471

M
Mr.doob 已提交
472
	},
M
Mr.doob 已提交
473
	multiplyVector3: function ( vector ) {
474

F
Franklin Ta 已提交
475 476
		console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
		return vector.applyMatrix4( this );
477

M
Mr.doob 已提交
478
	},
M
Mr.doob 已提交
479
	multiplyVector4: function ( vector ) {
480

M
Mr.doob 已提交
481 482
		console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
		return vector.applyMatrix4( this );
483

M
Mr.doob 已提交
484
	},
M
Mr.doob 已提交
485
	multiplyVector3Array: function ( a ) {
486

M
Mr.doob 已提交
487 488
		console.warn( 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );
		return this.applyToVector3Array( a );
489

M
Mr.doob 已提交
490
	},
M
Mr.doob 已提交
491
	rotateAxis: function ( v ) {
492

M
Mr.doob 已提交
493 494
		console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' );
		v.transformDirection( this );
495

M
Mr.doob 已提交
496
	},
M
Mr.doob 已提交
497
	crossVector: function ( vector ) {
498

M
Mr.doob 已提交
499 500
		console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
		return vector.applyMatrix4( this );
501

M
Mr.doob 已提交
502
	},
M
Mr.doob 已提交
503
	translate: function () {
504

M
Mr.doob 已提交
505
		console.error( 'THREE.Matrix4: .translate() has been removed.' );
506

M
Mr.doob 已提交
507
	},
M
Mr.doob 已提交
508
	rotateX: function () {
509

M
Mr.doob 已提交
510
		console.error( 'THREE.Matrix4: .rotateX() has been removed.' );
511

M
Mr.doob 已提交
512
	},
M
Mr.doob 已提交
513
	rotateY: function () {
514

M
Mr.doob 已提交
515
		console.error( 'THREE.Matrix4: .rotateY() has been removed.' );
516

M
Mr.doob 已提交
517
	},
M
Mr.doob 已提交
518
	rotateZ: function () {
519

M
Mr.doob 已提交
520
		console.error( 'THREE.Matrix4: .rotateZ() has been removed.' );
521

M
Mr.doob 已提交
522
	},
M
Mr.doob 已提交
523
	rotateByAxis: function () {
524

M
Mr.doob 已提交
525
		console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' );
526

527 528 529
	},
	applyToBuffer: function( buffer, offset, length ) {

530 531
		console.warn( 'THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' );
		return this.applyToBufferAttribute( buffer );
532

533 534 535 536 537
	},
	applyToVector3Array: function( array, offset, length ) {

		console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' );

538 539 540
	},
	makeFrustum: function( left, right, bottom, top, near, far ) {

541
		console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' );
542
		return this.makePerspective( left, right, top, bottom, near, far );
543

M
Mr.doob 已提交
544
	}
M
Mr.doob 已提交
545

M
Mr.doob 已提交
546 547
} );

M
Mr.doob 已提交
548
Plane.prototype.isIntersectionLine = function ( line ) {
549

M
Mr.doob 已提交
550 551
	console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' );
	return this.intersectsLine( line );
552

M
Mr.doob 已提交
553
};
M
Mr.doob 已提交
554

M
Mr.doob 已提交
555
Quaternion.prototype.multiplyVector3 = function ( vector ) {
556

M
Mr.doob 已提交
557 558
	console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' );
	return vector.applyQuaternion( this );
559

M
Mr.doob 已提交
560
};
M
Mr.doob 已提交
561

562
Object.assign( Ray.prototype, {
M
Mr.doob 已提交
563

M
Mr.doob 已提交
564
	isIntersectionBox: function ( box ) {
565

M
Mr.doob 已提交
566 567
		console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );
		return this.intersectsBox( box );
568

M
Mr.doob 已提交
569
	},
M
Mr.doob 已提交
570
	isIntersectionPlane: function ( plane ) {
571

M
Mr.doob 已提交
572 573
		console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );
		return this.intersectsPlane( plane );
574

M
Mr.doob 已提交
575
	},
M
Mr.doob 已提交
576
	isIntersectionSphere: function ( sphere ) {
577

M
Mr.doob 已提交
578 579
		console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
		return this.intersectsSphere( sphere );
580

M
Mr.doob 已提交
581
	}
M
Mr.doob 已提交
582

M
Mr.doob 已提交
583 584
} );

585
Object.assign( Shape.prototype, {
M
Mr.doob 已提交
586

587
	extrude: function ( options ) {
588

589 590
		console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' );
		return new ExtrudeGeometry( this, options );
591

592 593
	},
	makeGeometry: function ( options ) {
594

595 596
		console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' );
		return new ShapeGeometry( this, options );
597

598
	}
M
Mr.doob 已提交
599

600 601
} );

602 603 604 605 606 607 608 609 610 611 612
Object.assign( Vector2.prototype, {

	fromAttribute: function ( attribute, index, offset ) {

		console.error( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' );
		return this.fromBufferAttribute( attribute, index, offset );

	}

} );

613
Object.assign( Vector3.prototype, {
M
Mr.doob 已提交
614

M
Mr.doob 已提交
615
	setEulerFromRotationMatrix: function () {
616

M
Mr.doob 已提交
617
		console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' );
618

M
Mr.doob 已提交
619
	},
M
Mr.doob 已提交
620
	setEulerFromQuaternion: function () {
621

M
Mr.doob 已提交
622
		console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' );
623

M
Mr.doob 已提交
624
	},
M
Mr.doob 已提交
625
	getPositionFromMatrix: function ( m ) {
626

M
Mr.doob 已提交
627 628
		console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' );
		return this.setFromMatrixPosition( m );
629

M
Mr.doob 已提交
630
	},
M
Mr.doob 已提交
631
	getScaleFromMatrix: function ( m ) {
632

M
Mr.doob 已提交
633 634
		console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' );
		return this.setFromMatrixScale( m );
635

M
Mr.doob 已提交
636
	},
M
Mr.doob 已提交
637
	getColumnFromMatrix: function ( index, matrix ) {
638

M
Mr.doob 已提交
639 640
		console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' );
		return this.setFromMatrixColumn( matrix, index );
641

642 643 644 645 646 647
	},
	applyProjection: function ( m ) {

		console.warn( 'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.' );
		return this.applyMatrix4( m );

648
	},
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
	fromAttribute: function ( attribute, index, offset ) {

		console.error( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' );
		return this.fromBufferAttribute( attribute, index, offset );

	}

} );

Object.assign( Vector4.prototype, {

	fromAttribute: function ( attribute, index, offset ) {

		console.error( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );
		return this.fromBufferAttribute( attribute, index, offset );

M
Mr.doob 已提交
665
	}
M
Mr.doob 已提交
666

M
Mr.doob 已提交
667 668 669 670
} );

//

M
Mr.doob 已提交
671
Geometry.prototype.computeTangents = function () {
672

M
Mr.doob 已提交
673
	console.warn( 'THREE.Geometry: .computeTangents() has been removed.' );
L
looeee 已提交
674

M
Mr.doob 已提交
675
};
L
looeee 已提交
676

677
Object.assign( Object3D.prototype, {
M
Mr.doob 已提交
678

M
Mr.doob 已提交
679
	getChildByName: function ( name ) {
680

M
Mr.doob 已提交
681 682
		console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
		return this.getObjectByName( name );
683

M
Mr.doob 已提交
684
	},
M
Mr.doob 已提交
685
	renderDepth: function () {
686

M
Mr.doob 已提交
687
		console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' );
688

M
Mr.doob 已提交
689 690
	},
	translate: function ( distance, axis ) {
691

M
Mr.doob 已提交
692 693
		console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
		return this.translateOnAxis( axis, distance );
694

M
Mr.doob 已提交
695
	}
M
Mr.doob 已提交
696

M
Mr.doob 已提交
697
} );
M
Mr.doob 已提交
698

699
Object.defineProperties( Object3D.prototype, {
M
Mr.doob 已提交
700

M
Mr.doob 已提交
701 702
	eulerOrder: {
		get: function () {
703

M
Mr.doob 已提交
704 705
			console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
			return this.rotation.order;
706

M
Mr.doob 已提交
707 708
		},
		set: function ( value ) {
709

M
Mr.doob 已提交
710 711
			console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
			this.rotation.order = value;
712

M
Mr.doob 已提交
713 714 715 716
		}
	},
	useQuaternion: {
		get: function () {
717

M
Mr.doob 已提交
718
			console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
719

M
Mr.doob 已提交
720
		},
M
Mr.doob 已提交
721
		set: function () {
722

M
Mr.doob 已提交
723
			console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
724

M
Mr.doob 已提交
725 726
		}
	}
M
Mr.doob 已提交
727

M
Mr.doob 已提交
728 729
} );

730
Object.defineProperties( LOD.prototype, {
M
Mr.doob 已提交
731

M
Mr.doob 已提交
732 733
	objects: {
		get: function () {
734

M
Mr.doob 已提交
735 736
			console.warn( 'THREE.LOD: .objects has been renamed to .levels.' );
			return this.levels;
737

M
Mr.doob 已提交
738 739
		}
	}
M
Mr.doob 已提交
740

M
Mr.doob 已提交
741 742
} );

M
Mr.doob 已提交
743 744
//

745
PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {
746 747 748 749 750 751 752 753 754 755 756

	console.warn( "THREE.PerspectiveCamera.setLens is deprecated. " +
			"Use .setFocalLength and .filmGauge for a photographic setup." );

	if ( filmGauge !== undefined ) this.filmGauge = filmGauge;
	this.setFocalLength( focalLength );

};

//

757
Object.defineProperties( Light.prototype, {
M
Mr.doob 已提交
758
	onlyShadow: {
M
Mr.doob 已提交
759
		set: function () {
760

M
Mr.doob 已提交
761
			console.warn( 'THREE.Light: .onlyShadow has been removed.' );
762

M
Mr.doob 已提交
763 764 765 766
		}
	},
	shadowCameraFov: {
		set: function ( value ) {
767

768
			console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' );
M
Mr.doob 已提交
769
			this.shadow.camera.fov = value;
770

M
Mr.doob 已提交
771 772 773 774
		}
	},
	shadowCameraLeft: {
		set: function ( value ) {
775

776
			console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' );
M
Mr.doob 已提交
777
			this.shadow.camera.left = value;
778

M
Mr.doob 已提交
779 780 781 782
		}
	},
	shadowCameraRight: {
		set: function ( value ) {
783

784
			console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' );
M
Mr.doob 已提交
785
			this.shadow.camera.right = value;
786

M
Mr.doob 已提交
787 788 789 790
		}
	},
	shadowCameraTop: {
		set: function ( value ) {
791

792
			console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' );
M
Mr.doob 已提交
793
			this.shadow.camera.top = value;
794

M
Mr.doob 已提交
795 796 797 798
		}
	},
	shadowCameraBottom: {
		set: function ( value ) {
799

800
			console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' );
M
Mr.doob 已提交
801
			this.shadow.camera.bottom = value;
802

M
Mr.doob 已提交
803 804 805 806
		}
	},
	shadowCameraNear: {
		set: function ( value ) {
807

808
			console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' );
M
Mr.doob 已提交
809
			this.shadow.camera.near = value;
810

M
Mr.doob 已提交
811 812 813 814
		}
	},
	shadowCameraFar: {
		set: function ( value ) {
815

816
			console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' );
M
Mr.doob 已提交
817
			this.shadow.camera.far = value;
818

M
Mr.doob 已提交
819 820 821
		}
	},
	shadowCameraVisible: {
M
Mr.doob 已提交
822
		set: function () {
823

824
			console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' );
825

M
Mr.doob 已提交
826 827 828 829
		}
	},
	shadowBias: {
		set: function ( value ) {
830

831
			console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' );
M
Mr.doob 已提交
832
			this.shadow.bias = value;
833

M
Mr.doob 已提交
834 835 836
		}
	},
	shadowDarkness: {
M
Mr.doob 已提交
837
		set: function () {
838

M
Mr.doob 已提交
839
			console.warn( 'THREE.Light: .shadowDarkness has been removed.' );
840

M
Mr.doob 已提交
841 842 843 844
		}
	},
	shadowMapWidth: {
		set: function ( value ) {
845

846
			console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' );
M
Mr.doob 已提交
847
			this.shadow.mapSize.width = value;
848

M
Mr.doob 已提交
849 850 851 852
		}
	},
	shadowMapHeight: {
		set: function ( value ) {
853

854
			console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' );
M
Mr.doob 已提交
855
			this.shadow.mapSize.height = value;
856

M
Mr.doob 已提交
857 858 859 860 861
		}
	}
} );

//
M
Mr.doob 已提交
862

863
Object.defineProperties( BufferAttribute.prototype, {
M
Mr.doob 已提交
864

M
Mr.doob 已提交
865 866
	length: {
		get: function () {
867

M
Mr.doob 已提交
868
			console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' );
M
Mr.doob 已提交
869
			return this.array.length;
870

M
Mr.doob 已提交
871 872
		}
	}
M
Mr.doob 已提交
873

M
Mr.doob 已提交
874 875
} );

876
Object.assign( BufferGeometry.prototype, {
M
Mr.doob 已提交
877

M
Mr.doob 已提交
878
	addIndex: function ( index ) {
879

M
Mr.doob 已提交
880 881
		console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
		this.setIndex( index );
882

M
Mr.doob 已提交
883 884
	},
	addDrawCall: function ( start, count, indexOffset ) {
885

M
Mr.doob 已提交
886
		if ( indexOffset !== undefined ) {
887

M
Mr.doob 已提交
888
			console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
889

M
Mr.doob 已提交
890 891 892
		}
		console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
		this.addGroup( start, count );
893

M
Mr.doob 已提交
894 895
	},
	clearDrawCalls: function () {
896

M
Mr.doob 已提交
897 898
		console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
		this.clearGroups();
899

M
Mr.doob 已提交
900 901
	},
	computeTangents: function () {
902

M
Mr.doob 已提交
903
		console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' );
904

M
Mr.doob 已提交
905 906
	},
	computeOffsets: function () {
907

M
Mr.doob 已提交
908
		console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
909

M
Mr.doob 已提交
910
	}
M
Mr.doob 已提交
911

M
Mr.doob 已提交
912 913
} );

914
Object.defineProperties( BufferGeometry.prototype, {
M
Mr.doob 已提交
915

916 917
	drawcalls: {
		get: function () {
918

919 920
			console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
			return this.groups;
921

922 923 924 925
		}
	},
	offsets: {
		get: function () {
926

927 928
			console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
			return this.groups;
929

930 931
		}
	}
M
Mr.doob 已提交
932

933 934
} );

M
Mr.doob 已提交
935 936
//

M
Mr.doob 已提交
937
Object.defineProperties( Uniform.prototype, {
M
Mr.doob 已提交
938

M
Mr.doob 已提交
939
	dynamic: {
M
Mr.doob 已提交
940
		set: function () {
941

M
Mr.doob 已提交
942
			console.warn( 'THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.' );
943

M
Mr.doob 已提交
944 945 946 947
		}
	},
	onUpdate: {
		value: function () {
948

M
Mr.doob 已提交
949 950
			console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' );
			return this;
951

M
Mr.doob 已提交
952 953
		}
	}
M
Mr.doob 已提交
954

M
Mr.doob 已提交
955 956 957 958
} );

//

959
Object.defineProperties( Material.prototype, {
M
Mr.doob 已提交
960

961 962 963 964 965 966 967 968 969 970 971 972 973 974
	skinning: {
		get: function () {

			console.warn( 'THREE.Material: .skinning has been removed.' );

		},
		set: function () {

			console.warn( 'THREE.Material: .skinning has been removed.' );

		}

	},

M
Mr.doob 已提交
975 976
	wrapAround: {
		get: function () {
977

M
Mr.doob 已提交
978
			console.warn( 'THREE.Material: .wrapAround has been removed.' );
979

M
Mr.doob 已提交
980
		},
M
Mr.doob 已提交
981
		set: function () {
982

M
Mr.doob 已提交
983
			console.warn( 'THREE.Material: .wrapAround has been removed.' );
984

M
Mr.doob 已提交
985 986 987 988
		}
	},
	wrapRGB: {
		get: function () {
989

M
Mr.doob 已提交
990
			console.warn( 'THREE.Material: .wrapRGB has been removed.' );
991
			return new Color();
992

M
Mr.doob 已提交
993 994
		}
	}
M
Mr.doob 已提交
995

M
Mr.doob 已提交
996 997
} );

998
Object.defineProperties( MeshPhongMaterial.prototype, {
M
Mr.doob 已提交
999

1000 1001
	metal: {
		get: function () {
1002

1003
			console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
1004
			return false;
1005

1006
		},
M
Mr.doob 已提交
1007
		set: function () {
1008

1009
			console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' );
1010

1011 1012
		}
	}
M
Mr.doob 已提交
1013

1014 1015
} );

1016
Object.defineProperties( ShaderMaterial.prototype, {
M
Mr.doob 已提交
1017

M
Mr.doob 已提交
1018
	derivatives: {
M
Mr.doob 已提交
1019
		get: function () {
1020

1021
			console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
M
Mr.doob 已提交
1022
			return this.extensions.derivatives;
1023

M
Mr.doob 已提交
1024
		},
M
Mr.doob 已提交
1025
		set: function ( value ) {
1026

M
Mr.doob 已提交
1027 1028
			console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
			this.extensions.derivatives = value;
1029

M
Mr.doob 已提交
1030 1031
		}
	}
M
Mr.doob 已提交
1032

M
Mr.doob 已提交
1033 1034 1035
} );

//
M
Mr.doob 已提交
1036

1037
Object.assign( WebGLRenderer.prototype, {
M
Mr.doob 已提交
1038

M
Mr.doob 已提交
1039
	supportsFloatTextures: function () {
1040

M
Mr.doob 已提交
1041 1042
		console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' );
		return this.extensions.get( 'OES_texture_float' );
1043

M
Mr.doob 已提交
1044
	},
M
Mr.doob 已提交
1045
	supportsHalfFloatTextures: function () {
1046

M
Mr.doob 已提交
1047 1048
		console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' );
		return this.extensions.get( 'OES_texture_half_float' );
1049

M
Mr.doob 已提交
1050
	},
M
Mr.doob 已提交
1051
	supportsStandardDerivatives: function () {
1052

M
Mr.doob 已提交
1053 1054
		console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' );
		return this.extensions.get( 'OES_standard_derivatives' );
1055

M
Mr.doob 已提交
1056
	},
M
Mr.doob 已提交
1057
	supportsCompressedTextureS3TC: function () {
1058

M
Mr.doob 已提交
1059 1060
		console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' );
		return this.extensions.get( 'WEBGL_compressed_texture_s3tc' );
1061

M
Mr.doob 已提交
1062
	},
M
Mr.doob 已提交
1063
	supportsCompressedTexturePVRTC: function () {
1064

M
Mr.doob 已提交
1065 1066
		console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' );
		return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );
1067

M
Mr.doob 已提交
1068
	},
M
Mr.doob 已提交
1069
	supportsBlendMinMax: function () {
1070

M
Mr.doob 已提交
1071 1072
		console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' );
		return this.extensions.get( 'EXT_blend_minmax' );
1073

M
Mr.doob 已提交
1074
	},
M
Mr.doob 已提交
1075
	supportsVertexTextures: function () {
1076

1077
		console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );
M
Mr.doob 已提交
1078
		return this.capabilities.vertexTextures;
1079

M
Mr.doob 已提交
1080
	},
M
Mr.doob 已提交
1081
	supportsInstancedArrays: function () {
1082

M
Mr.doob 已提交
1083 1084
		console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' );
		return this.extensions.get( 'ANGLE_instanced_arrays' );
1085

1086
	},
M
Mr.doob 已提交
1087
	enableScissorTest: function ( boolean ) {
1088

M
Mr.doob 已提交
1089 1090
		console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
		this.setScissorTest( boolean );
1091

M
Mr.doob 已提交
1092
	},
M
Mr.doob 已提交
1093
	initMaterial: function () {
1094

M
Mr.doob 已提交
1095
		console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
1096

M
Mr.doob 已提交
1097
	},
M
Mr.doob 已提交
1098
	addPrePlugin: function () {
1099

M
Mr.doob 已提交
1100
		console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
1101

M
Mr.doob 已提交
1102
	},
M
Mr.doob 已提交
1103
	addPostPlugin: function () {
1104

M
Mr.doob 已提交
1105
		console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
1106

M
Mr.doob 已提交
1107
	},
M
Mr.doob 已提交
1108
	updateShadowMap: function () {
1109

M
Mr.doob 已提交
1110
		console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
1111

M
Mr.doob 已提交
1112
	}
M
Mr.doob 已提交
1113

M
Mr.doob 已提交
1114 1115
} );

1116
Object.defineProperties( WebGLRenderer.prototype, {
M
Mr.doob 已提交
1117

M
Mr.doob 已提交
1118 1119
	shadowMapEnabled: {
		get: function () {
1120

M
Mr.doob 已提交
1121
			return this.shadowMap.enabled;
1122

M
Mr.doob 已提交
1123 1124
		},
		set: function ( value ) {
1125

M
Mr.doob 已提交
1126 1127
			console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );
			this.shadowMap.enabled = value;
1128

M
Mr.doob 已提交
1129 1130 1131 1132
		}
	},
	shadowMapType: {
		get: function () {
1133

M
Mr.doob 已提交
1134
			return this.shadowMap.type;
1135

M
Mr.doob 已提交
1136 1137
		},
		set: function ( value ) {
1138

M
Mr.doob 已提交
1139 1140
			console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );
			this.shadowMap.type = value;
1141

M
Mr.doob 已提交
1142 1143 1144 1145
		}
	},
	shadowMapCullFace: {
		get: function () {
1146

M
Mr.doob 已提交
1147
			return this.shadowMap.cullFace;
1148

M
Mr.doob 已提交
1149 1150
		},
		set: function ( value ) {
1151

M
Mr.doob 已提交
1152 1153
			console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' );
			this.shadowMap.cullFace = value;
1154

M
Mr.doob 已提交
1155 1156 1157 1158
		}
	}
} );

1159
Object.defineProperties( WebGLShadowMap.prototype, {
M
Mr.doob 已提交
1160

M
Mr.doob 已提交
1161 1162
	cullFace: {
		get: function () {
1163

1164
			return this.renderReverseSided ? CullFaceFront : CullFaceBack;
1165

M
Mr.doob 已提交
1166 1167
		},
		set: function ( cullFace ) {
1168

1169
			var value = ( cullFace !== CullFaceBack );
M
Mr.doob 已提交
1170 1171
			console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." );
			this.renderReverseSided = value;
1172

M
Mr.doob 已提交
1173
		}
1174
	}
M
Mr.doob 已提交
1175

1176 1177
} );

M
Mr.doob 已提交
1178 1179
//

1180
Object.defineProperties( WebGLRenderTarget.prototype, {
M
Mr.doob 已提交
1181

M
Mr.doob 已提交
1182 1183
	wrapS: {
		get: function () {
1184

M
Mr.doob 已提交
1185 1186
			console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
			return this.texture.wrapS;
1187

M
Mr.doob 已提交
1188 1189
		},
		set: function ( value ) {
1190

M
Mr.doob 已提交
1191 1192
			console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
			this.texture.wrapS = value;
1193

M
Mr.doob 已提交
1194 1195 1196 1197
		}
	},
	wrapT: {
		get: function () {
1198

M
Mr.doob 已提交
1199 1200
			console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
			return this.texture.wrapT;
1201

M
Mr.doob 已提交
1202 1203
		},
		set: function ( value ) {
1204

M
Mr.doob 已提交
1205 1206
			console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
			this.texture.wrapT = value;
1207

M
Mr.doob 已提交
1208 1209 1210 1211
		}
	},
	magFilter: {
		get: function () {
1212

M
Mr.doob 已提交
1213 1214
			console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
			return this.texture.magFilter;
1215

M
Mr.doob 已提交
1216 1217
		},
		set: function ( value ) {
1218

M
Mr.doob 已提交
1219 1220
			console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
			this.texture.magFilter = value;
1221

M
Mr.doob 已提交
1222 1223 1224 1225
		}
	},
	minFilter: {
		get: function () {
1226

M
Mr.doob 已提交
1227 1228
			console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
			return this.texture.minFilter;
1229

M
Mr.doob 已提交
1230 1231
		},
		set: function ( value ) {
1232

M
Mr.doob 已提交
1233 1234
			console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
			this.texture.minFilter = value;
1235

M
Mr.doob 已提交
1236 1237 1238 1239
		}
	},
	anisotropy: {
		get: function () {
1240

M
Mr.doob 已提交
1241 1242
			console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
			return this.texture.anisotropy;
1243

M
Mr.doob 已提交
1244 1245
		},
		set: function ( value ) {
1246

M
Mr.doob 已提交
1247 1248
			console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
			this.texture.anisotropy = value;
1249

M
Mr.doob 已提交
1250 1251 1252 1253
		}
	},
	offset: {
		get: function () {
1254

M
Mr.doob 已提交
1255 1256
			console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
			return this.texture.offset;
1257

M
Mr.doob 已提交
1258 1259
		},
		set: function ( value ) {
1260

M
Mr.doob 已提交
1261 1262
			console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
			this.texture.offset = value;
1263

M
Mr.doob 已提交
1264 1265 1266 1267
		}
	},
	repeat: {
		get: function () {
1268

M
Mr.doob 已提交
1269 1270
			console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
			return this.texture.repeat;
1271

M
Mr.doob 已提交
1272 1273
		},
		set: function ( value ) {
1274

M
Mr.doob 已提交
1275 1276
			console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
			this.texture.repeat = value;
1277

M
Mr.doob 已提交
1278 1279 1280 1281
		}
	},
	format: {
		get: function () {
1282

M
Mr.doob 已提交
1283 1284
			console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
			return this.texture.format;
1285

M
Mr.doob 已提交
1286 1287
		},
		set: function ( value ) {
1288

M
Mr.doob 已提交
1289 1290
			console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
			this.texture.format = value;
1291

M
Mr.doob 已提交
1292 1293 1294 1295
		}
	},
	type: {
		get: function () {
1296

M
Mr.doob 已提交
1297 1298
			console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
			return this.texture.type;
1299

M
Mr.doob 已提交
1300 1301
		},
		set: function ( value ) {
1302

M
Mr.doob 已提交
1303 1304
			console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
			this.texture.type = value;
1305

M
Mr.doob 已提交
1306 1307 1308 1309
		}
	},
	generateMipmaps: {
		get: function () {
1310

M
Mr.doob 已提交
1311 1312
			console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
			return this.texture.generateMipmaps;
1313

M
Mr.doob 已提交
1314 1315
		},
		set: function ( value ) {
1316

M
Mr.doob 已提交
1317 1318
			console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
			this.texture.generateMipmaps = value;
1319

M
Mr.doob 已提交
1320 1321
		}
	}
M
Mr.doob 已提交
1322

M
Mr.doob 已提交
1323 1324 1325 1326
} );

//

M
Mr.doob 已提交
1327
Audio.prototype.load = function ( file ) {
1328

M
Mr.doob 已提交
1329 1330 1331 1332
	console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
	var scope = this;
	var audioLoader = new AudioLoader();
	audioLoader.load( file, function ( buffer ) {
1333

M
Mr.doob 已提交
1334
		scope.setBuffer( buffer );
1335

M
Mr.doob 已提交
1336 1337
	} );
	return this;
1338

M
Mr.doob 已提交
1339
};
1340

M
Mr.doob 已提交
1341
AudioAnalyser.prototype.getData = function () {
1342

M
Mr.doob 已提交
1343 1344
	console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
	return this.getFrequencyData();
1345

M
Mr.doob 已提交
1346
};
1347

1348 1349
//

M
Mr.doob 已提交
1350
export var GeometryUtils = {
1351 1352 1353 1354 1355 1356

	merge: function ( geometry1, geometry2, materialIndexOffset ) {

		console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
		var matrix;

1357
		if ( geometry2.isMesh ) {
1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378

			geometry2.matrixAutoUpdate && geometry2.updateMatrix();

			matrix = geometry2.matrix;
			geometry2 = geometry2.geometry;

		}

		geometry1.merge( geometry2, matrix, materialIndexOffset );

	},

	center: function ( geometry ) {

		console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
		return geometry.center();

	}

};

M
Mr.doob 已提交
1379
export var ImageUtils = {
1380 1381 1382 1383 1384 1385 1386

	crossOrigin: undefined,

	loadTexture: function ( url, mapping, onLoad, onError ) {

		console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );

1387
		var loader = new TextureLoader();
1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401
		loader.setCrossOrigin( this.crossOrigin );

		var texture = loader.load( url, onLoad, undefined, onError );

		if ( mapping ) texture.mapping = mapping;

		return texture;

	},

	loadTextureCube: function ( urls, mapping, onLoad, onError ) {

		console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );

1402
		var loader = new CubeTextureLoader();
1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414
		loader.setCrossOrigin( this.crossOrigin );

		var texture = loader.load( urls, onLoad, undefined, onError );

		if ( mapping ) texture.mapping = mapping;

		return texture;

	},

	loadCompressedTexture: function () {

M
Mr.doob 已提交
1415
		console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
1416 1417 1418 1419 1420

	},

	loadCompressedTextureCube: function () {

M
Mr.doob 已提交
1421
		console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
1422 1423 1424 1425 1426 1427 1428

	}

};

//

1429
export function Projector() {
M
Mr.doob 已提交
1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446

	console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );

	this.projectVector = function ( vector, camera ) {

		console.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
		vector.project( camera );

	};

	this.unprojectVector = function ( vector, camera ) {

		console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
		vector.unproject( camera );

	};

M
Mr.doob 已提交
1447
	this.pickingRay = function () {
M
Mr.doob 已提交
1448 1449 1450 1451 1452

		console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );

	};

1453
}
M
Mr.doob 已提交
1454

M
Mr.doob 已提交
1455 1456
//

1457
export function CanvasRenderer() {
M
Mr.doob 已提交
1458 1459 1460

	console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );

E
Eli Grey 已提交
1461
	this.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
M
Mr.doob 已提交
1462 1463 1464 1465 1466
	this.clear = function () {};
	this.render = function () {};
	this.setClearColor = function () {};
	this.setSize = function () {};

1467
}