Three.Legacy.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Object.assign( THREE, {
  5. Face4: function ( a, b, c, d, normal, color, materialIndex ) {
  6. console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' );
  7. return new THREE.Face3( a, b, c, normal, color, materialIndex );
  8. },
  9. MeshFaceMaterial: THREE.MultiMaterial,
  10. PointCloud: function ( geometry, material ) {
  11. console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' );
  12. return new THREE.Points( geometry, material );
  13. },
  14. Particle: THREE.Sprite,
  15. ParticleSystem: function ( geometry, material ) {
  16. console.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' );
  17. return new THREE.Points( geometry, material );
  18. },
  19. PointCloudMaterial: function ( parameters ) {
  20. console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' );
  21. return new THREE.PointsMaterial( parameters );
  22. },
  23. ParticleBasicMaterial: function ( parameters ) {
  24. console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' );
  25. return new THREE.PointsMaterial( parameters );
  26. },
  27. ParticleSystemMaterial: function ( parameters ) {
  28. console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' );
  29. return new THREE.PointsMaterial( parameters );
  30. },
  31. Vertex: function ( x, y, z ) {
  32. console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' );
  33. return new THREE.Vector3( x, y, z );
  34. }
  35. } );
  36. //
  37. Object.assign( THREE.Box2.prototype, {
  38. empty: function () {
  39. console.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' );
  40. return this.isEmpty();
  41. },
  42. isIntersectionBox: function ( box ) {
  43. console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' );
  44. return this.intersectsBox( box );
  45. }
  46. } );
  47. Object.assign( THREE.Box3.prototype, {
  48. empty: function () {
  49. console.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' );
  50. return this.isEmpty();
  51. },
  52. isIntersectionBox: function ( box ) {
  53. console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' );
  54. return this.intersectsBox( box );
  55. },
  56. isIntersectionSphere: function ( sphere ) {
  57. console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
  58. return this.intersectsSphere( sphere );
  59. }
  60. } );
  61. Object.assign( THREE.Matrix3.prototype, {
  62. multiplyVector3: function ( vector ) {
  63. console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' );
  64. return vector.applyMatrix3( this );
  65. },
  66. multiplyVector3Array: function ( a ) {
  67. console.warn( 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );
  68. return this.applyToVector3Array( a );
  69. }
  70. } );
  71. Object.assign( THREE.Matrix4.prototype, {
  72. extractPosition: function ( m ) {
  73. console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' );
  74. return this.copyPosition( m );
  75. },
  76. setRotationFromQuaternion: function ( q ) {
  77. console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );
  78. return this.makeRotationFromQuaternion( q );
  79. },
  80. multiplyVector3: function ( vector ) {
  81. console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.' );
  82. return vector.applyProjection( this );
  83. },
  84. multiplyVector4: function ( vector ) {
  85. console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  86. return vector.applyMatrix4( this );
  87. },
  88. multiplyVector3Array: function ( a ) {
  89. console.warn( 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );
  90. return this.applyToVector3Array( a );
  91. },
  92. rotateAxis: function ( v ) {
  93. console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' );
  94. v.transformDirection( this );
  95. },
  96. crossVector: function ( vector ) {
  97. console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  98. return vector.applyMatrix4( this );
  99. },
  100. translate: function ( v ) {
  101. console.error( 'THREE.Matrix4: .translate() has been removed.' );
  102. },
  103. rotateX: function ( angle ) {
  104. console.error( 'THREE.Matrix4: .rotateX() has been removed.' );
  105. },
  106. rotateY: function ( angle ) {
  107. console.error( 'THREE.Matrix4: .rotateY() has been removed.' );
  108. },
  109. rotateZ: function ( angle ) {
  110. console.error( 'THREE.Matrix4: .rotateZ() has been removed.' );
  111. },
  112. rotateByAxis: function ( axis, angle ) {
  113. console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' );
  114. }
  115. } );
  116. Object.assign( THREE.Plane.prototype, {
  117. isIntersectionLine: function ( line ) {
  118. console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' );
  119. return this.intersectsLine( line );
  120. }
  121. } );
  122. Object.assign( THREE.Quaternion.prototype, {
  123. multiplyVector3: function ( vector ) {
  124. console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' );
  125. return vector.applyQuaternion( this );
  126. }
  127. } );
  128. Object.assign( THREE.Ray.prototype, {
  129. isIntersectionBox: function ( box ) {
  130. console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );
  131. return this.intersectsBox( box );
  132. },
  133. isIntersectionPlane: function ( plane ) {
  134. console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );
  135. return this.intersectsPlane( plane );
  136. },
  137. isIntersectionSphere: function ( sphere ) {
  138. console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
  139. return this.intersectsSphere( sphere );
  140. }
  141. } );
  142. Object.assign( THREE.Vector3.prototype, {
  143. setEulerFromRotationMatrix: function () {
  144. console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' );
  145. },
  146. setEulerFromQuaternion: function () {
  147. console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' );
  148. },
  149. getPositionFromMatrix: function ( m ) {
  150. console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' );
  151. return this.setFromMatrixPosition( m );
  152. },
  153. getScaleFromMatrix: function ( m ) {
  154. console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' );
  155. return this.setFromMatrixScale( m );
  156. },
  157. getColumnFromMatrix: function ( index, matrix ) {
  158. console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' );
  159. return this.setFromMatrixColumn( matrix, index );
  160. }
  161. } );
  162. //
  163. Object.assign( THREE.Object3D.prototype, {
  164. getChildByName: function ( name ) {
  165. console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
  166. return this.getObjectByName( name );
  167. },
  168. renderDepth: function ( value ) {
  169. console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' );
  170. },
  171. translate: function ( distance, axis ) {
  172. console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
  173. return this.translateOnAxis( axis, distance );
  174. }
  175. } );
  176. Object.defineProperties( THREE.Object3D.prototype, {
  177. eulerOrder: {
  178. get: function () {
  179. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  180. return this.rotation.order;
  181. },
  182. set: function ( value ) {
  183. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  184. this.rotation.order = value;
  185. }
  186. },
  187. useQuaternion: {
  188. get: function () {
  189. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  190. },
  191. set: function ( value ) {
  192. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  193. }
  194. }
  195. } );
  196. Object.defineProperties( THREE.LOD.prototype, {
  197. objects: {
  198. get: function () {
  199. console.warn( 'THREE.LOD: .objects has been renamed to .levels.' );
  200. return this.levels;
  201. }
  202. }
  203. } );
  204. //
  205. THREE.PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {
  206. console.warn( "THREE.PerspectiveCamera.setLens is deprecated. " +
  207. "Use .setFocalLength and .filmGauge for a photographic setup." );
  208. if ( filmGauge !== undefined ) this.filmGauge = filmGauge;
  209. this.setFocalLength( focalLength );
  210. };
  211. //
  212. Object.defineProperties( THREE.Light.prototype, {
  213. onlyShadow: {
  214. set: function ( value ) {
  215. console.warn( 'THREE.Light: .onlyShadow has been removed.' );
  216. }
  217. },
  218. shadowCameraFov: {
  219. set: function ( value ) {
  220. console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' );
  221. this.shadow.camera.fov = value;
  222. }
  223. },
  224. shadowCameraLeft: {
  225. set: function ( value ) {
  226. console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' );
  227. this.shadow.camera.left = value;
  228. }
  229. },
  230. shadowCameraRight: {
  231. set: function ( value ) {
  232. console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' );
  233. this.shadow.camera.right = value;
  234. }
  235. },
  236. shadowCameraTop: {
  237. set: function ( value ) {
  238. console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' );
  239. this.shadow.camera.top = value;
  240. }
  241. },
  242. shadowCameraBottom: {
  243. set: function ( value ) {
  244. console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' );
  245. this.shadow.camera.bottom = value;
  246. }
  247. },
  248. shadowCameraNear: {
  249. set: function ( value ) {
  250. console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' );
  251. this.shadow.camera.near = value;
  252. }
  253. },
  254. shadowCameraFar: {
  255. set: function ( value ) {
  256. console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' );
  257. this.shadow.camera.far = value;
  258. }
  259. },
  260. shadowCameraVisible: {
  261. set: function ( value ) {
  262. console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' );
  263. }
  264. },
  265. shadowBias: {
  266. set: function ( value ) {
  267. console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' );
  268. this.shadow.bias = value;
  269. }
  270. },
  271. shadowDarkness: {
  272. set: function ( value ) {
  273. console.warn( 'THREE.Light: .shadowDarkness has been removed.' );
  274. }
  275. },
  276. shadowMapWidth: {
  277. set: function ( value ) {
  278. console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' );
  279. this.shadow.mapSize.width = value;
  280. }
  281. },
  282. shadowMapHeight: {
  283. set: function ( value ) {
  284. console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' );
  285. this.shadow.mapSize.height = value;
  286. }
  287. }
  288. } );
  289. //
  290. Object.defineProperties( THREE.BufferAttribute.prototype, {
  291. length: {
  292. get: function () {
  293. console.warn( 'THREE.BufferAttribute: .length has been deprecated. Please use .count.' );
  294. return this.array.length;
  295. }
  296. }
  297. } );
  298. Object.assign( THREE.BufferGeometry.prototype, {
  299. addIndex: function ( index ) {
  300. console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
  301. this.setIndex( index );
  302. },
  303. addDrawCall: function ( start, count, indexOffset ) {
  304. if ( indexOffset !== undefined ) {
  305. console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
  306. }
  307. console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
  308. this.addGroup( start, count );
  309. },
  310. clearDrawCalls: function () {
  311. console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
  312. this.clearGroups();
  313. },
  314. computeTangents: function () {
  315. console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' );
  316. },
  317. computeOffsets: function () {
  318. console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
  319. }
  320. } );
  321. Object.defineProperties( THREE.BufferGeometry.prototype, {
  322. drawcalls: {
  323. get: function () {
  324. console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
  325. return this.groups;
  326. }
  327. },
  328. offsets: {
  329. get: function () {
  330. console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
  331. return this.groups;
  332. }
  333. }
  334. } );
  335. //
  336. Object.defineProperties( THREE.Material.prototype, {
  337. wrapAround: {
  338. get: function () {
  339. console.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' );
  340. },
  341. set: function ( value ) {
  342. console.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' );
  343. }
  344. },
  345. wrapRGB: {
  346. get: function () {
  347. console.warn( 'THREE.' + this.type + ': .wrapRGB has been removed.' );
  348. return new THREE.Color();
  349. }
  350. }
  351. } );
  352. Object.defineProperties( THREE.MeshPhongMaterial.prototype, {
  353. metal: {
  354. get: function () {
  355. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
  356. return false;
  357. },
  358. set: function ( value ) {
  359. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' );
  360. }
  361. }
  362. } );
  363. Object.defineProperties( THREE.ShaderMaterial.prototype, {
  364. derivatives: {
  365. get: function () {
  366. console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  367. return this.extensions.derivatives;
  368. },
  369. set: function ( value ) {
  370. console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  371. this.extensions.derivatives = value;
  372. }
  373. }
  374. } );
  375. //
  376. THREE.EventDispatcher.prototype = Object.assign( Object.create( {
  377. // Note: Extra base ensures these properties are not 'assign'ed.
  378. constructor: THREE.EventDispatcher,
  379. apply: function ( target ) {
  380. console.warn( "THREE.EventDispatcher: .apply is deprecated, " +
  381. "just inherit or Object.assign the prototype to mix-in." );
  382. Object.assign( target, this );
  383. }
  384. } ), THREE.EventDispatcher.prototype );
  385. //
  386. Object.assign( THREE.WebGLRenderer.prototype, {
  387. supportsFloatTextures: function () {
  388. console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' );
  389. return this.extensions.get( 'OES_texture_float' );
  390. },
  391. supportsHalfFloatTextures: function () {
  392. console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' );
  393. return this.extensions.get( 'OES_texture_half_float' );
  394. },
  395. supportsStandardDerivatives: function () {
  396. console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' );
  397. return this.extensions.get( 'OES_standard_derivatives' );
  398. },
  399. supportsCompressedTextureS3TC: function () {
  400. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' );
  401. return this.extensions.get( 'WEBGL_compressed_texture_s3tc' );
  402. },
  403. supportsCompressedTexturePVRTC: function () {
  404. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' );
  405. return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );
  406. },
  407. supportsBlendMinMax: function () {
  408. console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' );
  409. return this.extensions.get( 'EXT_blend_minmax' );
  410. },
  411. supportsVertexTextures: function () {
  412. return this.capabilities.vertexTextures;
  413. },
  414. supportsInstancedArrays: function () {
  415. console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' );
  416. return this.extensions.get( 'ANGLE_instanced_arrays' );
  417. },
  418. enableScissorTest: function ( boolean ) {
  419. console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
  420. this.setScissorTest( boolean );
  421. },
  422. initMaterial: function () {
  423. console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
  424. },
  425. addPrePlugin: function () {
  426. console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
  427. },
  428. addPostPlugin: function () {
  429. console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
  430. },
  431. updateShadowMap: function () {
  432. console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
  433. }
  434. } );
  435. Object.defineProperties( THREE.WebGLRenderer.prototype, {
  436. shadowMapEnabled: {
  437. get: function () {
  438. return this.shadowMap.enabled;
  439. },
  440. set: function ( value ) {
  441. console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );
  442. this.shadowMap.enabled = value;
  443. }
  444. },
  445. shadowMapType: {
  446. get: function () {
  447. return this.shadowMap.type;
  448. },
  449. set: function ( value ) {
  450. console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );
  451. this.shadowMap.type = value;
  452. }
  453. },
  454. shadowMapCullFace: {
  455. get: function () {
  456. return this.shadowMap.cullFace;
  457. },
  458. set: function ( value ) {
  459. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' );
  460. this.shadowMap.cullFace = value;
  461. }
  462. }
  463. } );
  464. Object.defineProperties( THREE.WebGLShadowMap.prototype, {
  465. cullFace: {
  466. get: function () {
  467. return this.renderReverseSided ? THREE.CullFaceFront : THREE.CullFaceBack;
  468. },
  469. set: function ( cullFace ) {
  470. var value = ( cullFace !== THREE.CullFaceBack );
  471. console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." );
  472. this.renderReverseSided = value;
  473. }
  474. }
  475. } );
  476. //
  477. Object.defineProperties( THREE.WebGLRenderTarget.prototype, {
  478. wrapS: {
  479. get: function () {
  480. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  481. return this.texture.wrapS;
  482. },
  483. set: function ( value ) {
  484. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  485. this.texture.wrapS = value;
  486. }
  487. },
  488. wrapT: {
  489. get: function () {
  490. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  491. return this.texture.wrapT;
  492. },
  493. set: function ( value ) {
  494. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  495. this.texture.wrapT = value;
  496. }
  497. },
  498. magFilter: {
  499. get: function () {
  500. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  501. return this.texture.magFilter;
  502. },
  503. set: function ( value ) {
  504. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  505. this.texture.magFilter = value;
  506. }
  507. },
  508. minFilter: {
  509. get: function () {
  510. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  511. return this.texture.minFilter;
  512. },
  513. set: function ( value ) {
  514. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  515. this.texture.minFilter = value;
  516. }
  517. },
  518. anisotropy: {
  519. get: function () {
  520. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  521. return this.texture.anisotropy;
  522. },
  523. set: function ( value ) {
  524. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  525. this.texture.anisotropy = value;
  526. }
  527. },
  528. offset: {
  529. get: function () {
  530. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  531. return this.texture.offset;
  532. },
  533. set: function ( value ) {
  534. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  535. this.texture.offset = value;
  536. }
  537. },
  538. repeat: {
  539. get: function () {
  540. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  541. return this.texture.repeat;
  542. },
  543. set: function ( value ) {
  544. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  545. this.texture.repeat = value;
  546. }
  547. },
  548. format: {
  549. get: function () {
  550. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  551. return this.texture.format;
  552. },
  553. set: function ( value ) {
  554. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  555. this.texture.format = value;
  556. }
  557. },
  558. type: {
  559. get: function () {
  560. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  561. return this.texture.type;
  562. },
  563. set: function ( value ) {
  564. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  565. this.texture.type = value;
  566. }
  567. },
  568. generateMipmaps: {
  569. get: function () {
  570. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  571. return this.texture.generateMipmaps;
  572. },
  573. set: function ( value ) {
  574. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  575. this.texture.generateMipmaps = value;
  576. }
  577. }
  578. } );
  579. //
  580. Object.assign( THREE.Audio.prototype, {
  581. load: function ( file ) {
  582. console.warn( 'THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.' );
  583. var scope = this;
  584. var audioLoader = new THREE.AudioLoader();
  585. audioLoader.load( file, function ( buffer ) {
  586. scope.setBuffer( buffer );
  587. } );
  588. return this;
  589. }
  590. } );
  591. Object.assign( THREE.AudioAnalyser.prototype, {
  592. getData: function ( file ) {
  593. console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
  594. return this.getFrequencyData();
  595. }
  596. } );
  597. //
  598. THREE.GeometryUtils = {
  599. merge: function ( geometry1, geometry2, materialIndexOffset ) {
  600. console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
  601. var matrix;
  602. if ( geometry2 instanceof THREE.Mesh ) {
  603. geometry2.matrixAutoUpdate && geometry2.updateMatrix();
  604. matrix = geometry2.matrix;
  605. geometry2 = geometry2.geometry;
  606. }
  607. geometry1.merge( geometry2, matrix, materialIndexOffset );
  608. },
  609. center: function ( geometry ) {
  610. console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
  611. return geometry.center();
  612. }
  613. };
  614. THREE.ImageUtils = {
  615. crossOrigin: undefined,
  616. loadTexture: function ( url, mapping, onLoad, onError ) {
  617. console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );
  618. var loader = new THREE.TextureLoader();
  619. loader.setCrossOrigin( this.crossOrigin );
  620. var texture = loader.load( url, onLoad, undefined, onError );
  621. if ( mapping ) texture.mapping = mapping;
  622. return texture;
  623. },
  624. loadTextureCube: function ( urls, mapping, onLoad, onError ) {
  625. console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );
  626. var loader = new THREE.CubeTextureLoader();
  627. loader.setCrossOrigin( this.crossOrigin );
  628. var texture = loader.load( urls, onLoad, undefined, onError );
  629. if ( mapping ) texture.mapping = mapping;
  630. return texture;
  631. },
  632. loadCompressedTexture: function () {
  633. console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
  634. },
  635. loadCompressedTextureCube: function () {
  636. console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
  637. }
  638. };
  639. //
  640. THREE.Projector = function () {
  641. console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
  642. this.projectVector = function ( vector, camera ) {
  643. console.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
  644. vector.project( camera );
  645. };
  646. this.unprojectVector = function ( vector, camera ) {
  647. console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
  648. vector.unproject( camera );
  649. };
  650. this.pickingRay = function ( vector, camera ) {
  651. console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );
  652. };
  653. };
  654. //
  655. THREE.CanvasRenderer = function () {
  656. console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
  657. this.domElement = document.createElement( 'canvas' );
  658. this.clear = function () {};
  659. this.render = function () {};
  660. this.setClearColor = function () {};
  661. this.setSize = function () {};
  662. };