Three.Legacy.js 20 KB

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