Three.Legacy.js 36.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';
69 70 71

export { BoxGeometry as CubeGeometry };

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

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

77 78
}

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

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

83 84
export function MeshFaceMaterial( materials ) {

M
Mr.doob 已提交
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
	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;
103 104 105 106

}

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

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

}

export function Particle( material ) {

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

118 119
}

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

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

125 126
}

127 128
export function PointCloudMaterial( parameters ) {

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

132 133
}

134 135
export function ParticleBasicMaterial( parameters ) {

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

139 140
}

141 142
export function ParticleSystemMaterial( parameters ) {

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

146 147
}

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

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

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

//

157
export function DynamicBufferAttribute( array, itemSize ) {
158

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

162 163 164
}

export function Int8Attribute( array, itemSize ) {
165

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

169 170 171
}

export function Uint8Attribute( array, itemSize ) {
172

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

176 177 178
}

export function Uint8ClampedAttribute( array, itemSize ) {
179

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

183 184 185
}

export function Int16Attribute( array, itemSize ) {
186

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

190 191 192
}

export function Uint16Attribute( array, itemSize ) {
193

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

197 198 199
}

export function Int32Attribute( array, itemSize ) {
200

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

204 205 206
}

export function Uint32Attribute( array, itemSize ) {
207

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

211 212 213
}

export function Float32Attribute( array, itemSize ) {
214

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

218 219 220
}

export function Float64Attribute( array, itemSize ) {
221

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

225 226 227 228
}

//

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

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

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

}

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

M
Mugen87 已提交
255 256 257 258
//

export function SplineCurve3( points ) {

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

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

}

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

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

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

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

	},
	getControlPointsArray: function ( optionalTarget ) {

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

	},
	reparametrizeByArcLength: function ( samplingCoef ) {

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

	}

} );

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

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

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

309
export function EdgesHelper( object, hex ) {
310

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

314 315
}

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

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

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

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

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

328
export function WireframeHelper( object, hex ) {
329

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

333 334 335 336
}

//

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

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

M
Mr.doob 已提交
342 343
}

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

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

}

M
Mr.doob 已提交
351 352
//

353
Object.assign( Box2.prototype, {
354

355
	center: function ( optionalTarget ) {
356

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

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

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

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

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

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

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

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

381
Object.assign( Box3.prototype, {
382

383
	center: function ( optionalTarget ) {
384

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

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

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

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

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

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

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

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

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

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

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

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

M
Mr.doob 已提交
420
};
421

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

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

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

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

431
	flattenToArrayOffset: function ( array, offset ) {
432

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		var v1;

		return function getPosition() {
481

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

L
looeee 已提交
486 487 488
		};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

613
	extrude: function ( options ) {
614

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

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

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

624
	}
M
Mr.doob 已提交
625

626 627
} );

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

	}

} );

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

//

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

769 770 771 772 773 774 775 776 777 778 779 780 781 782 783
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 已提交
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
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 已提交
801 802
//

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

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

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

};

//

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

//
M
Mr.doob 已提交
920

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

991 992
} );

M
Mr.doob 已提交
993 994
//

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

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

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

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

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

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

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

//

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

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

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

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

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

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

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

M
Mr.doob 已提交
1037 1038
		}
	}
M
Mr.doob 已提交
1039

M
Mr.doob 已提交
1040 1041
} );

1042
Object.defineProperties( MeshPhongMaterial.prototype, {
M
Mr.doob 已提交
1043

1044 1045
	metal: {
		get: function () {
1046

1047
			console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
1048
			return false;
1049

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

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

1055 1056
		}
	}
M
Mr.doob 已提交
1057

1058 1059
} );

1060
Object.defineProperties( ShaderMaterial.prototype, {
M
Mr.doob 已提交
1061

M
Mr.doob 已提交
1062
	derivatives: {
M
Mr.doob 已提交
1063
		get: function () {
1064

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

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

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

M
Mr.doob 已提交
1074 1075
		}
	}
M
Mr.doob 已提交
1076

M
Mr.doob 已提交
1077 1078 1079
} );

//
M
Mr.doob 已提交
1080

1081
Object.assign( WebGLRenderer.prototype, {
M
Mr.doob 已提交
1082

1083 1084 1085 1086 1087 1088 1089
	getCurrentRenderTarget: function () {

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

	},

M
Mr.doob 已提交
1090
	supportsFloatTextures: function () {
1091

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

M
Mr.doob 已提交
1095
	},
M
Mr.doob 已提交
1096
	supportsHalfFloatTextures: function () {
1097

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

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

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

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

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

M
Mr.doob 已提交
1113
	},
M
Mr.doob 已提交
1114
	supportsCompressedTexturePVRTC: function () {
1115

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

M
Mr.doob 已提交
1119
	},
M
Mr.doob 已提交
1120
	supportsBlendMinMax: function () {
1121

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

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

1128
		console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );
M
Mr.doob 已提交
1129
		return this.capabilities.vertexTextures;
1130

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

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

1137
	},
M
Mr.doob 已提交
1138
	enableScissorTest: function ( boolean ) {
1139

M
Mr.doob 已提交
1140 1141
		console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
		this.setScissorTest( boolean );
1142

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

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

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

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

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

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

M
Mr.doob 已提交
1158
	},
M
Mr.doob 已提交
1159
	updateShadowMap: function () {
1160

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

M
Mr.doob 已提交
1163
	}
M
Mr.doob 已提交
1164

M
Mr.doob 已提交
1165 1166
} );

1167
Object.defineProperties( WebGLRenderer.prototype, {
M
Mr.doob 已提交
1168

M
Mr.doob 已提交
1169 1170
	shadowMapEnabled: {
		get: function () {
1171

M
Mr.doob 已提交
1172
			return this.shadowMap.enabled;
1173

M
Mr.doob 已提交
1174 1175
		},
		set: function ( value ) {
1176

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

M
Mr.doob 已提交
1180 1181 1182 1183
		}
	},
	shadowMapType: {
		get: function () {
1184

M
Mr.doob 已提交
1185
			return this.shadowMap.type;
1186

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

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

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

M
Mr.doob 已提交
1198
			return this.shadowMap.cullFace;
1199

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

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

M
Mr.doob 已提交
1206 1207 1208 1209
		}
	}
} );

1210
Object.defineProperties( WebGLShadowMap.prototype, {
M
Mr.doob 已提交
1211

M
Mr.doob 已提交
1212 1213
	cullFace: {
		get: function () {
1214

1215
			return this.renderReverseSided ? CullFaceFront : CullFaceBack;
1216

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

1220
			var value = ( cullFace !== CullFaceBack );
M
Mr.doob 已提交
1221 1222
			console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." );
			this.renderReverseSided = value;
1223

M
Mr.doob 已提交
1224
		}
1225
	}
M
Mr.doob 已提交
1226

1227 1228
} );

M
Mr.doob 已提交
1229 1230
//

1231
Object.defineProperties( WebGLRenderTarget.prototype, {
M
Mr.doob 已提交
1232

M
Mr.doob 已提交
1233 1234
	wrapS: {
		get: function () {
1235

M
Mr.doob 已提交
1236 1237
			console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
			return this.texture.wrapS;
1238

M
Mr.doob 已提交
1239 1240
		},
		set: function ( value ) {
1241

M
Mr.doob 已提交
1242 1243
			console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
			this.texture.wrapS = value;
1244

M
Mr.doob 已提交
1245 1246 1247 1248
		}
	},
	wrapT: {
		get: function () {
1249

M
Mr.doob 已提交
1250 1251
			console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
			return this.texture.wrapT;
1252

M
Mr.doob 已提交
1253 1254
		},
		set: function ( value ) {
1255

M
Mr.doob 已提交
1256 1257
			console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
			this.texture.wrapT = value;
1258

M
Mr.doob 已提交
1259 1260 1261 1262
		}
	},
	magFilter: {
		get: function () {
1263

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

M
Mr.doob 已提交
1371 1372
		}
	}
M
Mr.doob 已提交
1373

M
Mr.doob 已提交
1374 1375 1376 1377
} );

//

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

M
Mr.doob 已提交
1380 1381 1382 1383
	console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
	var scope = this;
	var audioLoader = new AudioLoader();
	audioLoader.load( file, function ( buffer ) {
1384

M
Mr.doob 已提交
1385
		scope.setBuffer( buffer );
1386

M
Mr.doob 已提交
1387 1388
	} );
	return this;
1389

M
Mr.doob 已提交
1390
};
1391

M
Mr.doob 已提交
1392
AudioAnalyser.prototype.getData = function () {
1393

M
Mr.doob 已提交
1394 1395
	console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
	return this.getFrequencyData();
1396

M
Mr.doob 已提交
1397
};
1398

1399 1400
//

M
Mr.doob 已提交
1401
export var GeometryUtils = {
1402 1403 1404 1405 1406 1407

	merge: function ( geometry1, geometry2, materialIndexOffset ) {

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

1408
		if ( geometry2.isMesh ) {
1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429

			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 已提交
1430
export var ImageUtils = {
1431 1432 1433 1434 1435 1436 1437

	crossOrigin: undefined,

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

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

1438
		var loader = new TextureLoader();
1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452
		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.' );

1453
		var loader = new CubeTextureLoader();
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465
		loader.setCrossOrigin( this.crossOrigin );

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

		if ( mapping ) texture.mapping = mapping;

		return texture;

	},

	loadCompressedTexture: function () {

M
Mr.doob 已提交
1466
		console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
1467 1468 1469 1470 1471

	},

	loadCompressedTextureCube: function () {

M
Mr.doob 已提交
1472
		console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
1473 1474 1475 1476 1477 1478 1479

	}

};

//

1480
export function Projector() {
M
Mr.doob 已提交
1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497

	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 已提交
1498
	this.pickingRay = function () {
M
Mr.doob 已提交
1499 1500 1501 1502 1503

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

	};

1504
}
M
Mr.doob 已提交
1505

M
Mr.doob 已提交
1506 1507
//

1508
export function CanvasRenderer() {
M
Mr.doob 已提交
1509 1510 1511

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

E
Eli Grey 已提交
1512
	this.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
M
Mr.doob 已提交
1513 1514 1515 1516 1517
	this.clear = function () {};
	this.render = function () {};
	this.setClearColor = function () {};
	this.setSize = function () {};

1518
}