Three.Legacy.js 37.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 { SkeletonHelper } from './helpers/SkeletonHelper.js';
31
import { BoxGeometry } from './geometries/BoxGeometry.js';
32
import { EdgesGeometry } from './geometries/EdgesGeometry.js';
33 34
import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js';
import { ShapeGeometry } from './geometries/ShapeGeometry.js';
35
import { WireframeGeometry } from './geometries/WireframeGeometry.js';
36
import { Light } from './lights/Light.js';
M
Mr.doob 已提交
37
import { FileLoader } from './loaders/FileLoader.js';
38 39
import { AudioLoader } from './loaders/AudioLoader.js';
import { CubeTextureLoader } from './loaders/CubeTextureLoader.js';
L
Lewy Blue 已提交
40
import { DataTextureLoader } from './loaders/DataTextureLoader.js';
41 42
import { TextureLoader } from './loaders/TextureLoader.js';
import { Material } from './materials/Material.js';
43
import { LineBasicMaterial } from './materials/LineBasicMaterial.js';
44 45 46 47 48 49
import { MeshPhongMaterial } from './materials/MeshPhongMaterial.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
import { LOD } from './objects/LOD.js';
import { Points } from './objects/Points.js';
import { Sprite } from './objects/Sprite.js';
64
import { Skeleton } from './objects/Skeleton.js';
65 66 67
import { WebGLRenderer } from './renderers/WebGLRenderer.js';
import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
import { WebGLShadowMap } from './renderers/webgl/WebGLShadowMap.js';
68
import { Shape } from './extras/core/Shape.js';
W
WestLangley 已提交
69
import { CubeCamera } from './cameras/CubeCamera.js';
70 71 72

export { BoxGeometry as CubeGeometry };

73 74
export function Face4( a, b, c, d, normal, color, materialIndex ) {

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

78 79
}

M
Mr.doob 已提交
80
export var LineStrip = 0;
81

M
Mr.doob 已提交
82
export var LinePieces = 1;
83

84 85
export function MeshFaceMaterial( materials ) {

M
Mr.doob 已提交
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
	console.warn( 'THREE.MeshFaceMaterial has been removed. Use an Array instead.' );
	return materials;

}

export function MultiMaterial( materials ) {

	if ( materials === undefined ) materials = [];

	console.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' );
	materials.isMultiMaterial = true;
	materials.materials = materials;
	materials.clone = function () {

		return materials.slice();

	};
	return materials;
104 105 106 107

}

export function PointCloud( geometry, material ) {
108 109 110

	console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' );
	return new Points( geometry, material );
111 112 113 114 115

}

export function Particle( material ) {

M
Mr.doob 已提交
116
	console.warn( 'THREE.Particle has been renamed to THREE.Sprite.' );
117 118
	return new Sprite( material );

119 120
}

121
export function ParticleSystem( geometry, material ) {
122 123 124

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

126 127
}

128 129
export function PointCloudMaterial( parameters ) {

130 131
	console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' );
	return new PointsMaterial( parameters );
132

133 134
}

135 136
export function ParticleBasicMaterial( parameters ) {

137 138
	console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' );
	return new PointsMaterial( parameters );
139

140 141
}

142 143
export function ParticleSystemMaterial( parameters ) {

144 145
	console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' );
	return new PointsMaterial( parameters );
146

147 148
}

149 150
export function Vertex( x, y, z ) {

151 152
	console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' );
	return new Vector3( x, y, z );
153

154
}
M
Mr.doob 已提交
155 156 157

//

158
export function DynamicBufferAttribute( array, itemSize ) {
159

160 161
	console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.' );
	return new BufferAttribute( array, itemSize ).setDynamic( true );
162

163 164 165
}

export function Int8Attribute( array, itemSize ) {
166

167 168
	console.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.' );
	return new Int8BufferAttribute( array, itemSize );
169

170 171 172
}

export function Uint8Attribute( array, itemSize ) {
173

174 175
	console.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.' );
	return new Uint8BufferAttribute( array, itemSize );
176

177 178 179
}

export function Uint8ClampedAttribute( array, itemSize ) {
180

181 182
	console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.' );
	return new Uint8ClampedBufferAttribute( array, itemSize );
183

184 185 186
}

export function Int16Attribute( array, itemSize ) {
187

188 189
	console.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.' );
	return new Int16BufferAttribute( array, itemSize );
190

191 192 193
}

export function Uint16Attribute( array, itemSize ) {
194

195 196
	console.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.' );
	return new Uint16BufferAttribute( array, itemSize );
197

198 199 200
}

export function Int32Attribute( array, itemSize ) {
201

202 203
	console.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.' );
	return new Int32BufferAttribute( array, itemSize );
204

205 206 207
}

export function Uint32Attribute( array, itemSize ) {
208

209 210
	console.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.' );
	return new Uint32BufferAttribute( array, itemSize );
211

212 213 214
}

export function Float32Attribute( array, itemSize ) {
215

216 217
	console.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.' );
	return new Float32BufferAttribute( array, itemSize );
218

219 220 221
}

export function Float64Attribute( array, itemSize ) {
222

223 224
	console.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.' );
	return new Float64BufferAttribute( array, itemSize );
225

226 227 228 229
}

//

230 231 232 233 234 235 236 237 238 239 240 241 242 243
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 已提交
244
export function ClosedSplineCurve3( points ) {
L
looeee 已提交
245

M
Mr.doob 已提交
246
	console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' );
L
looeee 已提交
247 248 249 250 251 252 253 254 255

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

}

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

M
Mugen87 已提交
256 257 258 259
//

export function SplineCurve3( points ) {

M
Mugen87 已提交
260
	console.warn( 'THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' );
M
Mugen87 已提交
261 262 263 264 265 266 267

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

}

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

M
Mugen87 已提交
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
//

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 ) {

286
		console.error( 'THREE.Spline: .initFromArray() has been removed.' );
M
Mugen87 已提交
287 288 289 290

	},
	getControlPointsArray: function ( optionalTarget ) {

291
		console.error( 'THREE.Spline: .getControlPointsArray() has been removed.' );
M
Mugen87 已提交
292 293 294 295

	},
	reparametrizeByArcLength: function ( samplingCoef ) {

296
		console.error( 'THREE.Spline: .reparametrizeByArcLength() has been removed.' );
M
Mugen87 已提交
297 298 299 300 301

	}

} );

L
looeee 已提交
302
//
M
Mr.doob 已提交
303 304
export function BoundingBoxHelper( object, color ) {

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

M
Mr.doob 已提交
308
}
L
looeee 已提交
309

310
export function EdgesHelper( object, hex ) {
311

312 313
	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 } ) );
314

315 316
}

M
Mr.doob 已提交
317
GridHelper.prototype.setColors = function () {
318

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

M
Mr.doob 已提交
321
};
L
looeee 已提交
322

323 324 325
SkeletonHelper.prototype.update = function () {

	console.error( 'THREE.SkeletonHelper: update() no longer needs to be called.' );
326

327 328
};

329
export function WireframeHelper( object, hex ) {
330

331 332
	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 } ) );
333

334 335 336 337
}

//

M
Mr.doob 已提交
338
export function XHRLoader( manager ) {
339

M
Mr.doob 已提交
340 341
	console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' );
	return new FileLoader( manager );
342

M
Mr.doob 已提交
343 344
}

L
Lewy Blue 已提交
345 346 347 348 349 350 351
export function BinaryTextureLoader( manager ) {

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

}

M
Mr.doob 已提交
352 353
//

354
Object.assign( Box2.prototype, {
355

356
	center: function ( optionalTarget ) {
357

358 359
		console.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' );
		return this.getCenter( optionalTarget );
360

361
	},
M
Mr.doob 已提交
362
	empty: function () {
363

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

367
	},
M
Mr.doob 已提交
368
	isIntersectionBox: function ( box ) {
369

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

373 374
	},
	size: function ( optionalTarget ) {
375

376 377
		console.warn( 'THREE.Box2: .size() has been renamed to .getSize().' );
		return this.getSize( optionalTarget );
378

M
Mr.doob 已提交
379 380 381
	}
} );

382
Object.assign( Box3.prototype, {
383

384
	center: function ( optionalTarget ) {
385

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

389
	},
M
Mr.doob 已提交
390
	empty: function () {
391

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

395
	},
M
Mr.doob 已提交
396
	isIntersectionBox: function ( box ) {
397

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

M
Mr.doob 已提交
401
	},
M
Mr.doob 已提交
402
	isIntersectionSphere: function ( sphere ) {
403

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

407 408
	},
	size: function ( optionalTarget ) {
409

410 411
		console.warn( 'THREE.Box3: .size() has been renamed to .getSize().' );
		return this.getSize( optionalTarget );
412

M
Mr.doob 已提交
413 414 415
	}
} );

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

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

M
Mr.doob 已提交
421
};
422

M
Mr.doob 已提交
423
_Math.random16 = function () {
424

M
Mr.doob 已提交
425 426
	console.warn( 'THREE.Math.random16() has been deprecated. Use Math.random() instead.' );
	return Math.random();
427

M
Mr.doob 已提交
428
};
L
looeee 已提交
429

430
Object.assign( Matrix3.prototype, {
M
Mr.doob 已提交
431

432
	flattenToArrayOffset: function ( array, offset ) {
433

434 435
		console.warn( "THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." );
		return this.toArray( array, offset );
436

437
	},
M
Mr.doob 已提交
438
	multiplyVector3: function ( vector ) {
439

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

M
Mr.doob 已提交
443
	},
M
Mr.doob 已提交
444
	multiplyVector3Array: function ( a ) {
445

M
Mugen87 已提交
446
		console.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.'  );
447

448 449 450
	},
	applyToBuffer: function( buffer, offset, length ) {

451 452
		console.warn( 'THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' );
		return this.applyToBufferAttribute( buffer );
453

454 455 456 457 458
	},
	applyToVector3Array: function( array, offset, length ) {

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

M
Mr.doob 已提交
459
	}
M
Mr.doob 已提交
460

M
Mr.doob 已提交
461 462
} );

463
Object.assign( Matrix4.prototype, {
M
Mr.doob 已提交
464

M
Mr.doob 已提交
465
	extractPosition: function ( m ) {
466

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

M
Mr.doob 已提交
470
	},
471 472
	flattenToArrayOffset: function ( array, offset ) {

473
		console.warn( "THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." );
474
		return this.toArray( array, offset );
475

476
	},
L
looeee 已提交
477 478 479 480 481
	getPosition: function () {

		var v1;

		return function getPosition() {
482

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

L
looeee 已提交
487 488 489
		};

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

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

M
Mr.doob 已提交
495 496 497 498 499
	},
	multiplyToArray: function () {

		console.warn( 'THREE.Matrix4: .multiplyToArray() has been removed.' );

M
Mr.doob 已提交
500
	},
M
Mr.doob 已提交
501
	multiplyVector3: function ( vector ) {
502

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

M
Mr.doob 已提交
506
	},
M
Mr.doob 已提交
507
	multiplyVector4: function ( vector ) {
508

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

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

M
Mugen87 已提交
515
		console.error( 'THREE.Matrix4: .multiplyVector3Array() has been removed.'  );
516

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

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

M
Mr.doob 已提交
523
	},
M
Mr.doob 已提交
524
	crossVector: function ( vector ) {
525

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

M
Mr.doob 已提交
529
	},
M
Mr.doob 已提交
530
	translate: function () {
531

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

M
Mr.doob 已提交
534
	},
M
Mr.doob 已提交
535
	rotateX: function () {
536

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

M
Mr.doob 已提交
539
	},
M
Mr.doob 已提交
540
	rotateY: function () {
541

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

M
Mr.doob 已提交
544
	},
M
Mr.doob 已提交
545
	rotateZ: function () {
546

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

M
Mr.doob 已提交
549
	},
M
Mr.doob 已提交
550
	rotateByAxis: function () {
551

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

554 555 556
	},
	applyToBuffer: function( buffer, offset, length ) {

557 558
		console.warn( 'THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' );
		return this.applyToBufferAttribute( buffer );
559

560 561 562 563 564
	},
	applyToVector3Array: function( array, offset, length ) {

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

565 566 567
	},
	makeFrustum: function( left, right, bottom, top, near, far ) {

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

M
Mr.doob 已提交
571
	}
M
Mr.doob 已提交
572

M
Mr.doob 已提交
573 574
} );

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

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

M
Mr.doob 已提交
580
};
M
Mr.doob 已提交
581

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

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

M
Mr.doob 已提交
587
};
M
Mr.doob 已提交
588

589
Object.assign( Ray.prototype, {
M
Mr.doob 已提交
590

M
Mr.doob 已提交
591
	isIntersectionBox: function ( box ) {
592

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

M
Mr.doob 已提交
596
	},
M
Mr.doob 已提交
597
	isIntersectionPlane: function ( plane ) {
598

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

M
Mr.doob 已提交
602
	},
M
Mr.doob 已提交
603
	isIntersectionSphere: function ( sphere ) {
604

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

M
Mr.doob 已提交
608
	}
M
Mr.doob 已提交
609

M
Mr.doob 已提交
610 611
} );

612
Object.assign( Shape.prototype, {
M
Mr.doob 已提交
613

614
	extrude: function ( options ) {
615

616 617
		console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' );
		return new ExtrudeGeometry( this, options );
618

619 620
	},
	makeGeometry: function ( options ) {
621

622 623
		console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' );
		return new ShapeGeometry( this, options );
624

625
	}
M
Mr.doob 已提交
626

627 628
} );

629 630 631 632 633 634 635 636 637 638 639
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 );

	}

} );

640
Object.assign( Vector3.prototype, {
M
Mr.doob 已提交
641

M
Mr.doob 已提交
642
	setEulerFromRotationMatrix: function () {
643

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

M
Mr.doob 已提交
646
	},
M
Mr.doob 已提交
647
	setEulerFromQuaternion: function () {
648

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

M
Mr.doob 已提交
651
	},
M
Mr.doob 已提交
652
	getPositionFromMatrix: function ( m ) {
653

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

M
Mr.doob 已提交
657
	},
M
Mr.doob 已提交
658
	getScaleFromMatrix: function ( m ) {
659

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

M
Mr.doob 已提交
663
	},
M
Mr.doob 已提交
664
	getColumnFromMatrix: function ( index, matrix ) {
665

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

669 670 671 672 673 674
	},
	applyProjection: function ( m ) {

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

675
	},
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
	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 已提交
692
	}
M
Mr.doob 已提交
693

M
Mr.doob 已提交
694 695 696 697
} );

//

M
Mr.doob 已提交
698
Geometry.prototype.computeTangents = function () {
699

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

M
Mr.doob 已提交
702
};
L
looeee 已提交
703

704
Object.assign( Object3D.prototype, {
M
Mr.doob 已提交
705

M
Mr.doob 已提交
706
	getChildByName: function ( name ) {
707

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

M
Mr.doob 已提交
711
	},
M
Mr.doob 已提交
712
	renderDepth: function () {
713

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

M
Mr.doob 已提交
716 717
	},
	translate: function ( distance, axis ) {
718

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

M
Mr.doob 已提交
722
	}
M
Mr.doob 已提交
723

M
Mr.doob 已提交
724
} );
M
Mr.doob 已提交
725

726
Object.defineProperties( Object3D.prototype, {
M
Mr.doob 已提交
727

M
Mr.doob 已提交
728 729
	eulerOrder: {
		get: function () {
730

M
Mr.doob 已提交
731 732
			console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
			return this.rotation.order;
733

M
Mr.doob 已提交
734 735
		},
		set: function ( value ) {
736

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

M
Mr.doob 已提交
740 741 742 743
		}
	},
	useQuaternion: {
		get: function () {
744

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

M
Mr.doob 已提交
747
		},
M
Mr.doob 已提交
748
		set: function () {
749

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

M
Mr.doob 已提交
752 753
		}
	}
M
Mr.doob 已提交
754

M
Mr.doob 已提交
755 756
} );

757
Object.defineProperties( LOD.prototype, {
M
Mr.doob 已提交
758

M
Mr.doob 已提交
759 760
	objects: {
		get: function () {
761

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

M
Mr.doob 已提交
765 766
		}
	}
M
Mr.doob 已提交
767

M
Mr.doob 已提交
768 769
} );

770 771 772 773 774 775 776 777 778 779 780 781 782 783 784
Object.defineProperty( Skeleton.prototype, 'useVertexTexture', {

	get: function () {

		console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' );

	},
	set: function () {

		console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' );

	}

} );

M
Mugen87 已提交
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801
Object.defineProperty( Curve.prototype, '__arcLengthDivisions', {

	get: function () {

		console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' );
		return this.arcLengthDivisions;

	},
	set: function ( value ) {

		console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' );
		this.arcLengthDivisions = value;

	}

} );

M
Mr.doob 已提交
802 803
//

804
PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {
805 806 807 808 809 810 811 812 813 814 815

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

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

};

//

816
Object.defineProperties( Light.prototype, {
M
Mr.doob 已提交
817
	onlyShadow: {
M
Mr.doob 已提交
818
		set: function () {
819

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

M
Mr.doob 已提交
822 823 824 825
		}
	},
	shadowCameraFov: {
		set: function ( value ) {
826

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

M
Mr.doob 已提交
830 831 832 833
		}
	},
	shadowCameraLeft: {
		set: function ( value ) {
834

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

M
Mr.doob 已提交
838 839 840 841
		}
	},
	shadowCameraRight: {
		set: function ( value ) {
842

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

M
Mr.doob 已提交
846 847 848 849
		}
	},
	shadowCameraTop: {
		set: function ( value ) {
850

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

M
Mr.doob 已提交
854 855 856 857
		}
	},
	shadowCameraBottom: {
		set: function ( value ) {
858

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

M
Mr.doob 已提交
862 863 864 865
		}
	},
	shadowCameraNear: {
		set: function ( value ) {
866

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

M
Mr.doob 已提交
870 871 872 873
		}
	},
	shadowCameraFar: {
		set: function ( value ) {
874

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

M
Mr.doob 已提交
878 879 880
		}
	},
	shadowCameraVisible: {
M
Mr.doob 已提交
881
		set: function () {
882

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

M
Mr.doob 已提交
885 886 887 888
		}
	},
	shadowBias: {
		set: function ( value ) {
889

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

M
Mr.doob 已提交
893 894 895
		}
	},
	shadowDarkness: {
M
Mr.doob 已提交
896
		set: function () {
897

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

M
Mr.doob 已提交
900 901 902 903
		}
	},
	shadowMapWidth: {
		set: function ( value ) {
904

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

M
Mr.doob 已提交
908 909 910 911
		}
	},
	shadowMapHeight: {
		set: function ( value ) {
912

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

M
Mr.doob 已提交
916 917 918 919 920
		}
	}
} );

//
M
Mr.doob 已提交
921

922
Object.defineProperties( BufferAttribute.prototype, {
M
Mr.doob 已提交
923

M
Mr.doob 已提交
924 925
	length: {
		get: function () {
926

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

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

M
Mr.doob 已提交
933 934
} );

935
Object.assign( BufferGeometry.prototype, {
M
Mr.doob 已提交
936

M
Mr.doob 已提交
937
	addIndex: function ( index ) {
938

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

M
Mr.doob 已提交
942 943
	},
	addDrawCall: function ( start, count, indexOffset ) {
944

M
Mr.doob 已提交
945
		if ( indexOffset !== undefined ) {
946

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

M
Mr.doob 已提交
949 950 951
		}
		console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
		this.addGroup( start, count );
952

M
Mr.doob 已提交
953 954
	},
	clearDrawCalls: function () {
955

M
Mr.doob 已提交
956 957
		console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
		this.clearGroups();
958

M
Mr.doob 已提交
959 960
	},
	computeTangents: function () {
961

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

M
Mr.doob 已提交
964 965
	},
	computeOffsets: function () {
966

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

M
Mr.doob 已提交
969
	}
M
Mr.doob 已提交
970

M
Mr.doob 已提交
971 972
} );

973
Object.defineProperties( BufferGeometry.prototype, {
M
Mr.doob 已提交
974

975 976
	drawcalls: {
		get: function () {
977

978 979
			console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
			return this.groups;
980

981 982 983 984
		}
	},
	offsets: {
		get: function () {
985

986 987
			console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
			return this.groups;
988

989 990
		}
	}
M
Mr.doob 已提交
991

992 993
} );

M
Mr.doob 已提交
994 995
//

M
Mr.doob 已提交
996
Object.defineProperties( Uniform.prototype, {
M
Mr.doob 已提交
997

M
Mr.doob 已提交
998
	dynamic: {
M
Mr.doob 已提交
999
		set: function () {
1000

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

M
Mr.doob 已提交
1003 1004 1005 1006
		}
	},
	onUpdate: {
		value: function () {
1007

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

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

M
Mr.doob 已提交
1014 1015 1016 1017
} );

//

1018
Object.defineProperties( Material.prototype, {
M
Mr.doob 已提交
1019

M
Mr.doob 已提交
1020 1021
	wrapAround: {
		get: function () {
1022

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

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

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

M
Mr.doob 已提交
1030 1031 1032 1033
		}
	},
	wrapRGB: {
		get: function () {
1034

M
Mr.doob 已提交
1035
			console.warn( 'THREE.Material: .wrapRGB has been removed.' );
1036
			return new Color();
1037

1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051
		}
	},

	shading: {
		get: function () {

			console.error( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );

		},
		set: function ( value ) {

			console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
			this.flatShading = ( value === THREE.FlatShading ) ? true : false;

M
Mr.doob 已提交
1052 1053
		}
	}
M
Mr.doob 已提交
1054

M
Mr.doob 已提交
1055 1056
} );

1057
Object.defineProperties( MeshPhongMaterial.prototype, {
M
Mr.doob 已提交
1058

1059 1060
	metal: {
		get: function () {
1061

1062
			console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
1063
			return false;
1064

1065
		},
M
Mr.doob 已提交
1066
		set: function () {
1067

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

1070 1071
		}
	}
M
Mr.doob 已提交
1072

1073 1074
} );

1075
Object.defineProperties( ShaderMaterial.prototype, {
M
Mr.doob 已提交
1076

M
Mr.doob 已提交
1077
	derivatives: {
M
Mr.doob 已提交
1078
		get: function () {
1079

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

M
Mr.doob 已提交
1083
		},
M
Mr.doob 已提交
1084
		set: function ( value ) {
1085

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

M
Mr.doob 已提交
1089 1090
		}
	}
M
Mr.doob 已提交
1091

M
Mr.doob 已提交
1092 1093 1094
} );

//
M
Mr.doob 已提交
1095

1096
Object.assign( WebGLRenderer.prototype, {
M
Mr.doob 已提交
1097

1098 1099 1100 1101 1102 1103 1104
	getCurrentRenderTarget: function () {

		console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' );
		return this.getRenderTarget();

	},

1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118
	getMaxAnisotropy: function () {

		console.warn( 'THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().' );
		return this.capabilities.getMaxAnisotropy();

	},

	getPrecision: function () {

		console.warn( 'THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.' );
		return this.capabilities.precision;

	},

M
Mr.doob 已提交
1119
	supportsFloatTextures: function () {
1120

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

M
Mr.doob 已提交
1124
	},
M
Mr.doob 已提交
1125
	supportsHalfFloatTextures: function () {
1126

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

M
Mr.doob 已提交
1130
	},
M
Mr.doob 已提交
1131
	supportsStandardDerivatives: function () {
1132

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

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

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

M
Mr.doob 已提交
1142
	},
M
Mr.doob 已提交
1143
	supportsCompressedTexturePVRTC: function () {
1144

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

M
Mr.doob 已提交
1148
	},
M
Mr.doob 已提交
1149
	supportsBlendMinMax: function () {
1150

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

M
Mr.doob 已提交
1154
	},
M
Mr.doob 已提交
1155
	supportsVertexTextures: function () {
1156

1157
		console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );
M
Mr.doob 已提交
1158
		return this.capabilities.vertexTextures;
1159

M
Mr.doob 已提交
1160
	},
M
Mr.doob 已提交
1161
	supportsInstancedArrays: function () {
1162

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

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

M
Mr.doob 已提交
1169 1170
		console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
		this.setScissorTest( boolean );
1171

M
Mr.doob 已提交
1172
	},
M
Mr.doob 已提交
1173
	initMaterial: function () {
1174

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

M
Mr.doob 已提交
1177
	},
M
Mr.doob 已提交
1178
	addPrePlugin: function () {
1179

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

M
Mr.doob 已提交
1182
	},
M
Mr.doob 已提交
1183
	addPostPlugin: function () {
1184

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

M
Mr.doob 已提交
1187
	},
M
Mr.doob 已提交
1188
	updateShadowMap: function () {
1189

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

M
Mr.doob 已提交
1192
	}
M
Mr.doob 已提交
1193

M
Mr.doob 已提交
1194 1195
} );

1196
Object.defineProperties( WebGLRenderer.prototype, {
M
Mr.doob 已提交
1197

M
Mr.doob 已提交
1198 1199
	shadowMapEnabled: {
		get: function () {
1200

M
Mr.doob 已提交
1201
			return this.shadowMap.enabled;
1202

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

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

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

M
Mr.doob 已提交
1214
			return this.shadowMap.type;
1215

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

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

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

M
Mr.doob 已提交
1227
			return this.shadowMap.cullFace;
1228

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

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

M
Mr.doob 已提交
1235 1236 1237 1238
		}
	}
} );

1239
Object.defineProperties( WebGLShadowMap.prototype, {
M
Mr.doob 已提交
1240

M
Mr.doob 已提交
1241 1242
	cullFace: {
		get: function () {
1243

1244
			return this.renderReverseSided ? CullFaceFront : CullFaceBack;
1245

M
Mr.doob 已提交
1246 1247
		},
		set: function ( cullFace ) {
1248

1249
			var value = ( cullFace !== CullFaceBack );
M
Mr.doob 已提交
1250 1251
			console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." );
			this.renderReverseSided = value;
1252

M
Mr.doob 已提交
1253
		}
1254
	}
M
Mr.doob 已提交
1255

1256 1257
} );

M
Mr.doob 已提交
1258 1259
//

1260
Object.defineProperties( WebGLRenderTarget.prototype, {
M
Mr.doob 已提交
1261

M
Mr.doob 已提交
1262 1263
	wrapS: {
		get: function () {
1264

M
Mr.doob 已提交
1265 1266
			console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
			return this.texture.wrapS;
1267

M
Mr.doob 已提交
1268 1269
		},
		set: function ( value ) {
1270

M
Mr.doob 已提交
1271 1272
			console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
			this.texture.wrapS = value;
1273

M
Mr.doob 已提交
1274 1275 1276 1277
		}
	},
	wrapT: {
		get: function () {
1278

M
Mr.doob 已提交
1279 1280
			console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
			return this.texture.wrapT;
1281

M
Mr.doob 已提交
1282 1283
		},
		set: function ( value ) {
1284

M
Mr.doob 已提交
1285 1286
			console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
			this.texture.wrapT = value;
1287

M
Mr.doob 已提交
1288 1289 1290 1291
		}
	},
	magFilter: {
		get: function () {
1292

M
Mr.doob 已提交
1293 1294
			console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
			return this.texture.magFilter;
1295

M
Mr.doob 已提交
1296 1297
		},
		set: function ( value ) {
1298

M
Mr.doob 已提交
1299 1300
			console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
			this.texture.magFilter = value;
1301

M
Mr.doob 已提交
1302 1303 1304 1305
		}
	},
	minFilter: {
		get: function () {
1306

M
Mr.doob 已提交
1307 1308
			console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
			return this.texture.minFilter;
1309

M
Mr.doob 已提交
1310 1311
		},
		set: function ( value ) {
1312

M
Mr.doob 已提交
1313 1314
			console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
			this.texture.minFilter = value;
1315

M
Mr.doob 已提交
1316 1317 1318 1319
		}
	},
	anisotropy: {
		get: function () {
1320

M
Mr.doob 已提交
1321 1322
			console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
			return this.texture.anisotropy;
1323

M
Mr.doob 已提交
1324 1325
		},
		set: function ( value ) {
1326

M
Mr.doob 已提交
1327 1328
			console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
			this.texture.anisotropy = value;
1329

M
Mr.doob 已提交
1330 1331 1332 1333
		}
	},
	offset: {
		get: function () {
1334

M
Mr.doob 已提交
1335 1336
			console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
			return this.texture.offset;
1337

M
Mr.doob 已提交
1338 1339
		},
		set: function ( value ) {
1340

M
Mr.doob 已提交
1341 1342
			console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
			this.texture.offset = value;
1343

M
Mr.doob 已提交
1344 1345 1346 1347
		}
	},
	repeat: {
		get: function () {
1348

M
Mr.doob 已提交
1349 1350
			console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
			return this.texture.repeat;
1351

M
Mr.doob 已提交
1352 1353
		},
		set: function ( value ) {
1354

M
Mr.doob 已提交
1355 1356
			console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
			this.texture.repeat = value;
1357

M
Mr.doob 已提交
1358 1359 1360 1361
		}
	},
	format: {
		get: function () {
1362

M
Mr.doob 已提交
1363 1364
			console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
			return this.texture.format;
1365

M
Mr.doob 已提交
1366 1367
		},
		set: function ( value ) {
1368

M
Mr.doob 已提交
1369 1370
			console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
			this.texture.format = value;
1371

M
Mr.doob 已提交
1372 1373 1374 1375
		}
	},
	type: {
		get: function () {
1376

M
Mr.doob 已提交
1377 1378
			console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
			return this.texture.type;
1379

M
Mr.doob 已提交
1380 1381
		},
		set: function ( value ) {
1382

M
Mr.doob 已提交
1383 1384
			console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
			this.texture.type = value;
1385

M
Mr.doob 已提交
1386 1387 1388 1389
		}
	},
	generateMipmaps: {
		get: function () {
1390

M
Mr.doob 已提交
1391 1392
			console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
			return this.texture.generateMipmaps;
1393

M
Mr.doob 已提交
1394 1395
		},
		set: function ( value ) {
1396

M
Mr.doob 已提交
1397 1398
			console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
			this.texture.generateMipmaps = value;
1399

M
Mr.doob 已提交
1400 1401
		}
	}
M
Mr.doob 已提交
1402

M
Mr.doob 已提交
1403 1404 1405 1406
} );

//

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

M
Mr.doob 已提交
1409 1410 1411 1412
	console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
	var scope = this;
	var audioLoader = new AudioLoader();
	audioLoader.load( file, function ( buffer ) {
1413

M
Mr.doob 已提交
1414
		scope.setBuffer( buffer );
1415

M
Mr.doob 已提交
1416 1417
	} );
	return this;
1418

M
Mr.doob 已提交
1419
};
1420

M
Mr.doob 已提交
1421
AudioAnalyser.prototype.getData = function () {
1422

M
Mr.doob 已提交
1423 1424
	console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
	return this.getFrequencyData();
1425

M
Mr.doob 已提交
1426
};
1427

1428 1429
//

W
WestLangley 已提交
1430 1431 1432 1433 1434 1435 1436 1437 1438
CubeCamera.prototype.updateCubeMap = function ( renderer, scene ) {

	console.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' );
	return this.update( renderer, scene );

};

//

M
Mr.doob 已提交
1439
export var GeometryUtils = {
1440 1441 1442 1443 1444 1445

	merge: function ( geometry1, geometry2, materialIndexOffset ) {

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

1446
		if ( geometry2.isMesh ) {
1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467

			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 已提交
1468
export var ImageUtils = {
1469 1470 1471 1472 1473 1474 1475

	crossOrigin: undefined,

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

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

1476
		var loader = new TextureLoader();
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490
		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.' );

1491
		var loader = new CubeTextureLoader();
1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503
		loader.setCrossOrigin( this.crossOrigin );

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

		if ( mapping ) texture.mapping = mapping;

		return texture;

	},

	loadCompressedTexture: function () {

M
Mr.doob 已提交
1504
		console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
1505 1506 1507 1508 1509

	},

	loadCompressedTextureCube: function () {

M
Mr.doob 已提交
1510
		console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
1511 1512 1513 1514 1515 1516 1517

	}

};

//

1518
export function Projector() {
M
Mr.doob 已提交
1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535

	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 已提交
1536
	this.pickingRay = function () {
M
Mr.doob 已提交
1537 1538 1539 1540 1541

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

	};

1542
}
M
Mr.doob 已提交
1543

M
Mr.doob 已提交
1544 1545
//

1546
export function CanvasRenderer() {
M
Mr.doob 已提交
1547 1548 1549

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

E
Eli Grey 已提交
1550
	this.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
M
Mr.doob 已提交
1551 1552 1553 1554 1555
	this.clear = function () {};
	this.render = function () {};
	this.setClearColor = function () {};
	this.setSize = function () {};

1556
}