Three.Legacy.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  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. Object.defineProperties( THREE.BufferGeometry.prototype, {
  318. drawcalls: {
  319. get: function () {
  320. console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
  321. return this.groups;
  322. }
  323. },
  324. offsets: {
  325. get: function () {
  326. console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
  327. return this.groups;
  328. }
  329. },
  330. addIndex: {
  331. value: function ( index ) {
  332. console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
  333. this.setIndex( index );
  334. }
  335. },
  336. addDrawCall: {
  337. value: function ( start, count, indexOffset ) {
  338. if ( indexOffset !== undefined ) {
  339. console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
  340. }
  341. console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
  342. this.addGroup( start, count );
  343. }
  344. },
  345. clearDrawCalls: {
  346. value: function () {
  347. console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
  348. this.clearGroups();
  349. }
  350. },
  351. computeTangents: {
  352. value: function () {
  353. console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' );
  354. }
  355. },
  356. computeOffsets: {
  357. value: function () {
  358. console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
  359. }
  360. }
  361. } );
  362. //
  363. Object.defineProperties( THREE.Material.prototype, {
  364. wrapAround: {
  365. get: function () {
  366. console.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' );
  367. },
  368. set: function ( value ) {
  369. console.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' );
  370. }
  371. },
  372. wrapRGB: {
  373. get: function () {
  374. console.warn( 'THREE.' + this.type + ': .wrapRGB has been removed.' );
  375. return new THREE.Color();
  376. }
  377. }
  378. } );
  379. Object.defineProperties( THREE, {
  380. PointCloudMaterial: {
  381. value: function ( parameters ) {
  382. console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' );
  383. return new THREE.PointsMaterial( parameters );
  384. }
  385. },
  386. ParticleBasicMaterial: {
  387. value: function ( parameters ) {
  388. console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' );
  389. return new THREE.PointsMaterial( parameters );
  390. }
  391. },
  392. ParticleSystemMaterial:{
  393. value: function ( parameters ) {
  394. console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' );
  395. return new THREE.PointsMaterial( parameters );
  396. }
  397. }
  398. } );
  399. Object.defineProperties( THREE.MeshPhongMaterial.prototype, {
  400. metal: {
  401. get: function () {
  402. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
  403. return false;
  404. },
  405. set: function ( value ) {
  406. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' );
  407. }
  408. }
  409. } );
  410. Object.defineProperties( THREE.ShaderMaterial.prototype, {
  411. derivatives: {
  412. get: function () {
  413. console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  414. return this.extensions.derivatives;
  415. },
  416. set: function ( value ) {
  417. console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  418. this.extensions.derivatives = value;
  419. }
  420. }
  421. } );
  422. //
  423. Object.defineProperties( THREE.WebGLRenderer.prototype, {
  424. supportsFloatTextures: {
  425. value: function () {
  426. console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' );
  427. return this.extensions.get( 'OES_texture_float' );
  428. }
  429. },
  430. supportsHalfFloatTextures: {
  431. value: function () {
  432. console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' );
  433. return this.extensions.get( 'OES_texture_half_float' );
  434. }
  435. },
  436. supportsStandardDerivatives: {
  437. value: function () {
  438. console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' );
  439. return this.extensions.get( 'OES_standard_derivatives' );
  440. }
  441. },
  442. supportsCompressedTextureS3TC: {
  443. value: function () {
  444. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' );
  445. return this.extensions.get( 'WEBGL_compressed_texture_s3tc' );
  446. }
  447. },
  448. supportsCompressedTexturePVRTC: {
  449. value: function () {
  450. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' );
  451. return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );
  452. }
  453. },
  454. supportsBlendMinMax: {
  455. value: function () {
  456. console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' );
  457. return this.extensions.get( 'EXT_blend_minmax' );
  458. }
  459. },
  460. supportsVertexTextures: {
  461. value: function () {
  462. return this.capabilities.vertexTextures;
  463. }
  464. },
  465. supportsInstancedArrays: {
  466. value: function () {
  467. console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' );
  468. return this.extensions.get( 'ANGLE_instanced_arrays' );
  469. }
  470. },
  471. enableScissorTest: {
  472. value: function ( boolean ) {
  473. console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
  474. this.setScissorTest( boolean );
  475. }
  476. },
  477. initMaterial: {
  478. value: function () {
  479. console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
  480. }
  481. },
  482. addPrePlugin: {
  483. value: function () {
  484. console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
  485. }
  486. },
  487. addPostPlugin: {
  488. value: function () {
  489. console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
  490. }
  491. },
  492. updateShadowMap: {
  493. value: function () {
  494. console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
  495. }
  496. },
  497. shadowMapEnabled: {
  498. get: function () {
  499. return this.shadowMap.enabled;
  500. },
  501. set: function ( value ) {
  502. console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );
  503. this.shadowMap.enabled = value;
  504. }
  505. },
  506. shadowMapType: {
  507. get: function () {
  508. return this.shadowMap.type;
  509. },
  510. set: function ( value ) {
  511. console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );
  512. this.shadowMap.type = value;
  513. }
  514. },
  515. shadowMapCullFace: {
  516. get: function () {
  517. return this.shadowMap.cullFace;
  518. },
  519. set: function ( value ) {
  520. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' );
  521. this.shadowMap.cullFace = value;
  522. }
  523. },
  524. shadowMapDebug: {
  525. get: function () {
  526. return this.shadowMap.debug;
  527. },
  528. set: function ( value ) {
  529. console.warn( 'THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.' );
  530. this.shadowMap.debug = value;
  531. }
  532. }
  533. } );
  534. //
  535. Object.defineProperties( THREE.WebGLRenderTarget.prototype, {
  536. wrapS: {
  537. get: function () {
  538. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  539. return this.texture.wrapS;
  540. },
  541. set: function ( value ) {
  542. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  543. this.texture.wrapS = value;
  544. }
  545. },
  546. wrapT: {
  547. get: function () {
  548. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  549. return this.texture.wrapT;
  550. },
  551. set: function ( value ) {
  552. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  553. this.texture.wrapT = value;
  554. }
  555. },
  556. magFilter: {
  557. get: function () {
  558. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  559. return this.texture.magFilter;
  560. },
  561. set: function ( value ) {
  562. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  563. this.texture.magFilter = value;
  564. }
  565. },
  566. minFilter: {
  567. get: function () {
  568. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  569. return this.texture.minFilter;
  570. },
  571. set: function ( value ) {
  572. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  573. this.texture.minFilter = value;
  574. }
  575. },
  576. anisotropy: {
  577. get: function () {
  578. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  579. return this.texture.anisotropy;
  580. },
  581. set: function ( value ) {
  582. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  583. this.texture.anisotropy = value;
  584. }
  585. },
  586. offset: {
  587. get: function () {
  588. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  589. return this.texture.offset;
  590. },
  591. set: function ( value ) {
  592. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  593. this.texture.offset = value;
  594. }
  595. },
  596. repeat: {
  597. get: function () {
  598. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  599. return this.texture.repeat;
  600. },
  601. set: function ( value ) {
  602. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  603. this.texture.repeat = value;
  604. }
  605. },
  606. format: {
  607. get: function () {
  608. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  609. return this.texture.format;
  610. },
  611. set: function ( value ) {
  612. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  613. this.texture.format = value;
  614. }
  615. },
  616. type: {
  617. get: function () {
  618. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  619. return this.texture.type;
  620. },
  621. set: function ( value ) {
  622. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  623. this.texture.type = value;
  624. }
  625. },
  626. generateMipmaps: {
  627. get: function () {
  628. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  629. return this.texture.generateMipmaps;
  630. },
  631. set: function ( value ) {
  632. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  633. this.texture.generateMipmaps = value;
  634. }
  635. }
  636. } );
  637. //
  638. THREE.GeometryUtils = {
  639. merge: function ( geometry1, geometry2, materialIndexOffset ) {
  640. console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
  641. var matrix;
  642. if ( geometry2 instanceof THREE.Mesh ) {
  643. geometry2.matrixAutoUpdate && geometry2.updateMatrix();
  644. matrix = geometry2.matrix;
  645. geometry2 = geometry2.geometry;
  646. }
  647. geometry1.merge( geometry2, matrix, materialIndexOffset );
  648. },
  649. center: function ( geometry ) {
  650. console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
  651. return geometry.center();
  652. }
  653. };
  654. THREE.ImageUtils = {
  655. crossOrigin: undefined,
  656. loadTexture: function ( url, mapping, onLoad, onError ) {
  657. console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );
  658. var loader = new THREE.TextureLoader();
  659. loader.setCrossOrigin( this.crossOrigin );
  660. var texture = loader.load( url, onLoad, undefined, onError );
  661. if ( mapping ) texture.mapping = mapping;
  662. return texture;
  663. },
  664. loadTextureCube: function ( urls, mapping, onLoad, onError ) {
  665. console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );
  666. var loader = new THREE.CubeTextureLoader();
  667. loader.setCrossOrigin( this.crossOrigin );
  668. var texture = loader.load( urls, onLoad, undefined, onError );
  669. if ( mapping ) texture.mapping = mapping;
  670. return texture;
  671. },
  672. loadCompressedTexture: function () {
  673. console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' )
  674. },
  675. loadCompressedTextureCube: function () {
  676. console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' )
  677. }
  678. };
  679. //
  680. THREE.Projector = function () {
  681. console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
  682. this.projectVector = function ( vector, camera ) {
  683. console.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
  684. vector.project( camera );
  685. };
  686. this.unprojectVector = function ( vector, camera ) {
  687. console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
  688. vector.unproject( camera );
  689. };
  690. this.pickingRay = function ( vector, camera ) {
  691. console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );
  692. };
  693. };
  694. //
  695. THREE.CanvasRenderer = function () {
  696. console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
  697. this.domElement = document.createElement( 'canvas' );
  698. this.clear = function () {};
  699. this.render = function () {};
  700. this.setClearColor = function () {};
  701. this.setSize = function () {};
  702. };
  703. //
  704. THREE.TextGeometry = function () {
  705. console.error( 'THREE.TextGeometry has been moved to /examples/js/geometries/TextGeometry.js' );
  706. console.error( 'THREE.FontUtils has been moved to /examples/js/utils/FontUtils.js' );
  707. };
  708. //
  709. THREE.MeshFaceMaterial = THREE.MultiMaterial;
粤ICP备19079148号