Three.Legacy.js 20 KB

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