Three.Legacy.js 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918
  1. import { Audio } from './audio/Audio.js';
  2. import { AudioAnalyser } from './audio/AudioAnalyser.js';
  3. import { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
  4. import {
  5. FlatShading,
  6. sRGBEncoding,
  7. LinearEncoding,
  8. StaticDrawUsage,
  9. DynamicDrawUsage,
  10. TrianglesDrawMode
  11. } from './constants.js';
  12. import {
  13. Float64BufferAttribute,
  14. Float32BufferAttribute,
  15. Uint32BufferAttribute,
  16. Int32BufferAttribute,
  17. Uint16BufferAttribute,
  18. Int16BufferAttribute,
  19. Uint8ClampedBufferAttribute,
  20. Uint8BufferAttribute,
  21. Int8BufferAttribute,
  22. BufferAttribute
  23. } from './core/BufferAttribute.js';
  24. import { BufferGeometry } from './core/BufferGeometry.js';
  25. import { InterleavedBuffer } from './core/InterleavedBuffer.js';
  26. import { Object3D } from './core/Object3D.js';
  27. import { Uniform } from './core/Uniform.js';
  28. import { Curve } from './extras/core/Curve.js';
  29. import { Path } from './extras/core/Path.js';
  30. import { AxesHelper } from './helpers/AxesHelper.js';
  31. import { BoxHelper } from './helpers/BoxHelper.js';
  32. import { GridHelper } from './helpers/GridHelper.js';
  33. import { SkeletonHelper } from './helpers/SkeletonHelper.js';
  34. import { EdgesGeometry } from './geometries/EdgesGeometry.js';
  35. import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js';
  36. import { ShapeGeometry } from './geometries/ShapeGeometry.js';
  37. import { WireframeGeometry } from './geometries/WireframeGeometry.js';
  38. import { Light } from './lights/Light.js';
  39. import { Loader } from './loaders/Loader.js';
  40. import { LoaderUtils } from './loaders/LoaderUtils.js';
  41. import { FileLoader } from './loaders/FileLoader.js';
  42. import { AudioLoader } from './loaders/AudioLoader.js';
  43. import { CubeTextureLoader } from './loaders/CubeTextureLoader.js';
  44. import { DataTextureLoader } from './loaders/DataTextureLoader.js';
  45. import { TextureLoader } from './loaders/TextureLoader.js';
  46. import { Material } from './materials/Material.js';
  47. import { LineBasicMaterial } from './materials/LineBasicMaterial.js';
  48. import { PointsMaterial } from './materials/PointsMaterial.js';
  49. import { ShaderMaterial } from './materials/ShaderMaterial.js';
  50. import { Box2 } from './math/Box2.js';
  51. import { Box3 } from './math/Box3.js';
  52. import { Sphere } from './math/Sphere.js';
  53. import { Color } from './math/Color.js';
  54. import { Frustum } from './math/Frustum.js';
  55. import { Line3 } from './math/Line3.js';
  56. import * as MathUtils from './math/MathUtils.js';
  57. import { Matrix3 } from './math/Matrix3.js';
  58. import { Matrix4 } from './math/Matrix4.js';
  59. import { Plane } from './math/Plane.js';
  60. import { Quaternion } from './math/Quaternion.js';
  61. import { Ray } from './math/Ray.js';
  62. import { Triangle } from './math/Triangle.js';
  63. import { Vector2 } from './math/Vector2.js';
  64. import { Vector3 } from './math/Vector3.js';
  65. import { Vector4 } from './math/Vector4.js';
  66. import { Mesh } from './objects/Mesh.js';
  67. import { LineSegments } from './objects/LineSegments.js';
  68. import { Points } from './objects/Points.js';
  69. import { Sprite } from './objects/Sprite.js';
  70. import { SkinnedMesh } from './objects/SkinnedMesh.js';
  71. import { WebGLRenderer } from './renderers/WebGLRenderer.js';
  72. import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
  73. import { WebGLCubeRenderTarget } from './renderers/WebGLCubeRenderTarget.js';
  74. import { WebGLShadowMap } from './renderers/webgl/WebGLShadowMap.js';
  75. import { ImageUtils } from './extras/ImageUtils.js';
  76. import { Shape } from './extras/core/Shape.js';
  77. import { CubeCamera } from './cameras/CubeCamera.js';
  78. import { Scene } from './scenes/Scene.js';
  79. export { MathUtils as Math };
  80. export const LineStrip = 0;
  81. export const LinePieces = 1;
  82. export const NoColors = 0;
  83. export const FaceColors = 1;
  84. export const VertexColors = 2;
  85. export function MeshFaceMaterial( materials ) {
  86. console.warn( 'THREE.MeshFaceMaterial has been removed. Use an Array instead.' );
  87. return materials;
  88. }
  89. export function MultiMaterial( materials = [] ) {
  90. console.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' );
  91. materials.isMultiMaterial = true;
  92. materials.materials = materials;
  93. materials.clone = function () {
  94. return materials.slice();
  95. };
  96. return materials;
  97. }
  98. export function PointCloud( geometry, material ) {
  99. console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' );
  100. return new Points( geometry, material );
  101. }
  102. export function Particle( material ) {
  103. console.warn( 'THREE.Particle has been renamed to THREE.Sprite.' );
  104. return new Sprite( material );
  105. }
  106. export function ParticleSystem( geometry, material ) {
  107. console.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' );
  108. return new Points( geometry, material );
  109. }
  110. export function PointCloudMaterial( parameters ) {
  111. console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' );
  112. return new PointsMaterial( parameters );
  113. }
  114. export function ParticleBasicMaterial( parameters ) {
  115. console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' );
  116. return new PointsMaterial( parameters );
  117. }
  118. export function ParticleSystemMaterial( parameters ) {
  119. console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' );
  120. return new PointsMaterial( parameters );
  121. }
  122. export function Vertex( x, y, z ) {
  123. console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' );
  124. return new Vector3( x, y, z );
  125. }
  126. //
  127. export function DynamicBufferAttribute( array, itemSize ) {
  128. console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.' );
  129. return new BufferAttribute( array, itemSize ).setUsage( DynamicDrawUsage );
  130. }
  131. export function Int8Attribute( array, itemSize ) {
  132. console.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.' );
  133. return new Int8BufferAttribute( array, itemSize );
  134. }
  135. export function Uint8Attribute( array, itemSize ) {
  136. console.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.' );
  137. return new Uint8BufferAttribute( array, itemSize );
  138. }
  139. export function Uint8ClampedAttribute( array, itemSize ) {
  140. console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.' );
  141. return new Uint8ClampedBufferAttribute( array, itemSize );
  142. }
  143. export function Int16Attribute( array, itemSize ) {
  144. console.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.' );
  145. return new Int16BufferAttribute( array, itemSize );
  146. }
  147. export function Uint16Attribute( array, itemSize ) {
  148. console.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.' );
  149. return new Uint16BufferAttribute( array, itemSize );
  150. }
  151. export function Int32Attribute( array, itemSize ) {
  152. console.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.' );
  153. return new Int32BufferAttribute( array, itemSize );
  154. }
  155. export function Uint32Attribute( array, itemSize ) {
  156. console.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.' );
  157. return new Uint32BufferAttribute( array, itemSize );
  158. }
  159. export function Float32Attribute( array, itemSize ) {
  160. console.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.' );
  161. return new Float32BufferAttribute( array, itemSize );
  162. }
  163. export function Float64Attribute( array, itemSize ) {
  164. console.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.' );
  165. return new Float64BufferAttribute( array, itemSize );
  166. }
  167. //
  168. Curve.create = function ( construct, getPoint ) {
  169. console.log( 'THREE.Curve.create() has been deprecated' );
  170. construct.prototype = Object.create( Curve.prototype );
  171. construct.prototype.constructor = construct;
  172. construct.prototype.getPoint = getPoint;
  173. return construct;
  174. };
  175. //
  176. Path.prototype.fromPoints = function ( points ) {
  177. console.warn( 'THREE.Path: .fromPoints() has been renamed to .setFromPoints().' );
  178. return this.setFromPoints( points );
  179. };
  180. //
  181. export function AxisHelper( size ) {
  182. console.warn( 'THREE.AxisHelper has been renamed to THREE.AxesHelper.' );
  183. return new AxesHelper( size );
  184. }
  185. export function BoundingBoxHelper( object, color ) {
  186. console.warn( 'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.' );
  187. return new BoxHelper( object, color );
  188. }
  189. export function EdgesHelper( object, hex ) {
  190. console.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' );
  191. return new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );
  192. }
  193. GridHelper.prototype.setColors = function () {
  194. console.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' );
  195. };
  196. SkeletonHelper.prototype.update = function () {
  197. console.error( 'THREE.SkeletonHelper: update() no longer needs to be called.' );
  198. };
  199. export function WireframeHelper( object, hex ) {
  200. console.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' );
  201. return new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );
  202. }
  203. //
  204. Loader.prototype.extractUrlBase = function ( url ) {
  205. console.warn( 'THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.' );
  206. return LoaderUtils.extractUrlBase( url );
  207. };
  208. Loader.Handlers = {
  209. add: function ( /* regex, loader */ ) {
  210. console.error( 'THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.' );
  211. },
  212. get: function ( /* file */ ) {
  213. console.error( 'THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.' );
  214. }
  215. };
  216. export function XHRLoader( manager ) {
  217. console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' );
  218. return new FileLoader( manager );
  219. }
  220. export function BinaryTextureLoader( manager ) {
  221. console.warn( 'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.' );
  222. return new DataTextureLoader( manager );
  223. }
  224. //
  225. Box2.prototype.center = function ( optionalTarget ) {
  226. console.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' );
  227. return this.getCenter( optionalTarget );
  228. };
  229. Box2.prototype.empty = function () {
  230. console.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' );
  231. return this.isEmpty();
  232. };
  233. Box2.prototype.isIntersectionBox = function ( box ) {
  234. console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' );
  235. return this.intersectsBox( box );
  236. };
  237. Box2.prototype.size = function ( optionalTarget ) {
  238. console.warn( 'THREE.Box2: .size() has been renamed to .getSize().' );
  239. return this.getSize( optionalTarget );
  240. };
  241. //
  242. Box3.prototype.center = function ( optionalTarget ) {
  243. console.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' );
  244. return this.getCenter( optionalTarget );
  245. };
  246. Box3.prototype.empty = function () {
  247. console.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' );
  248. return this.isEmpty();
  249. };
  250. Box3.prototype.isIntersectionBox = function ( box ) {
  251. console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' );
  252. return this.intersectsBox( box );
  253. };
  254. Box3.prototype.isIntersectionSphere = function ( sphere ) {
  255. console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
  256. return this.intersectsSphere( sphere );
  257. };
  258. Box3.prototype.size = function ( optionalTarget ) {
  259. console.warn( 'THREE.Box3: .size() has been renamed to .getSize().' );
  260. return this.getSize( optionalTarget );
  261. };
  262. //
  263. Sphere.prototype.empty = function () {
  264. console.warn( 'THREE.Sphere: .empty() has been renamed to .isEmpty().' );
  265. return this.isEmpty();
  266. };
  267. //
  268. Frustum.prototype.setFromMatrix = function ( m ) {
  269. console.warn( 'THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().' );
  270. return this.setFromProjectionMatrix( m );
  271. };
  272. //
  273. Line3.prototype.center = function ( optionalTarget ) {
  274. console.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' );
  275. return this.getCenter( optionalTarget );
  276. };
  277. //
  278. Matrix3.prototype.flattenToArrayOffset = function ( array, offset ) {
  279. console.warn( 'THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );
  280. return this.toArray( array, offset );
  281. };
  282. Matrix3.prototype.multiplyVector3 = function ( vector ) {
  283. console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' );
  284. return vector.applyMatrix3( this );
  285. };
  286. Matrix3.prototype.multiplyVector3Array = function ( /* a */ ) {
  287. console.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.' );
  288. };
  289. Matrix3.prototype.applyToBufferAttribute = function ( attribute ) {
  290. console.warn( 'THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.' );
  291. return attribute.applyMatrix3( this );
  292. };
  293. Matrix3.prototype.applyToVector3Array = function ( /* array, offset, length */ ) {
  294. console.error( 'THREE.Matrix3: .applyToVector3Array() has been removed.' );
  295. };
  296. Matrix3.prototype.getInverse = function ( matrix ) {
  297. console.warn( 'THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' );
  298. return this.copy( matrix ).invert();
  299. };
  300. //
  301. Matrix4.prototype.extractPosition = function ( m ) {
  302. console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' );
  303. return this.copyPosition( m );
  304. };
  305. Matrix4.prototype.flattenToArrayOffset = function ( array, offset ) {
  306. console.warn( 'THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );
  307. return this.toArray( array, offset );
  308. };
  309. Matrix4.prototype.getPosition = function () {
  310. console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' );
  311. return new Vector3().setFromMatrixColumn( this, 3 );
  312. };
  313. Matrix4.prototype.setRotationFromQuaternion = function ( q ) {
  314. console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );
  315. return this.makeRotationFromQuaternion( q );
  316. };
  317. Matrix4.prototype.multiplyToArray = function () {
  318. console.warn( 'THREE.Matrix4: .multiplyToArray() has been removed.' );
  319. };
  320. Matrix4.prototype.multiplyVector3 = function ( vector ) {
  321. console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  322. return vector.applyMatrix4( this );
  323. };
  324. Matrix4.prototype.multiplyVector4 = function ( vector ) {
  325. console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  326. return vector.applyMatrix4( this );
  327. };
  328. Matrix4.prototype.multiplyVector3Array = function ( /* a */ ) {
  329. console.error( 'THREE.Matrix4: .multiplyVector3Array() has been removed.' );
  330. };
  331. Matrix4.prototype.rotateAxis = function ( v ) {
  332. console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' );
  333. v.transformDirection( this );
  334. };
  335. Matrix4.prototype.crossVector = function ( vector ) {
  336. console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  337. return vector.applyMatrix4( this );
  338. };
  339. Matrix4.prototype.translate = function () {
  340. console.error( 'THREE.Matrix4: .translate() has been removed.' );
  341. };
  342. Matrix4.prototype.rotateX = function () {
  343. console.error( 'THREE.Matrix4: .rotateX() has been removed.' );
  344. };
  345. Matrix4.prototype.rotateY = function () {
  346. console.error( 'THREE.Matrix4: .rotateY() has been removed.' );
  347. };
  348. Matrix4.prototype.rotateZ = function () {
  349. console.error( 'THREE.Matrix4: .rotateZ() has been removed.' );
  350. };
  351. Matrix4.prototype.rotateByAxis = function () {
  352. console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' );
  353. };
  354. Matrix4.prototype.applyToBufferAttribute = function ( attribute ) {
  355. console.warn( 'THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.' );
  356. return attribute.applyMatrix4( this );
  357. };
  358. Matrix4.prototype.applyToVector3Array = function ( /* array, offset, length */ ) {
  359. console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' );
  360. };
  361. Matrix4.prototype.makeFrustum = function ( left, right, bottom, top, near, far ) {
  362. console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' );
  363. return this.makePerspective( left, right, top, bottom, near, far );
  364. };
  365. Matrix4.prototype.getInverse = function ( matrix ) {
  366. console.warn( 'THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' );
  367. return this.copy( matrix ).invert();
  368. };
  369. //
  370. Plane.prototype.isIntersectionLine = function ( line ) {
  371. console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' );
  372. return this.intersectsLine( line );
  373. };
  374. //
  375. Quaternion.prototype.multiplyVector3 = function ( vector ) {
  376. console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' );
  377. return vector.applyQuaternion( this );
  378. };
  379. Quaternion.prototype.inverse = function ( ) {
  380. console.warn( 'THREE.Quaternion: .inverse() has been renamed to invert().' );
  381. return this.invert();
  382. };
  383. //
  384. Ray.prototype.isIntersectionBox = function ( box ) {
  385. console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );
  386. return this.intersectsBox( box );
  387. };
  388. Ray.prototype.isIntersectionPlane = function ( plane ) {
  389. console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );
  390. return this.intersectsPlane( plane );
  391. };
  392. Ray.prototype.isIntersectionSphere = function ( sphere ) {
  393. console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
  394. return this.intersectsSphere( sphere );
  395. };
  396. //
  397. Triangle.prototype.area = function () {
  398. console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' );
  399. return this.getArea();
  400. };
  401. Triangle.prototype.barycoordFromPoint = function ( point, target ) {
  402. console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
  403. return this.getBarycoord( point, target );
  404. };
  405. Triangle.prototype.midpoint = function ( target ) {
  406. console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' );
  407. return this.getMidpoint( target );
  408. };
  409. Triangle.prototypenormal = function ( target ) {
  410. console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
  411. return this.getNormal( target );
  412. };
  413. Triangle.prototype.plane = function ( target ) {
  414. console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' );
  415. return this.getPlane( target );
  416. };
  417. Triangle.barycoordFromPoint = function ( point, a, b, c, target ) {
  418. console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
  419. return Triangle.getBarycoord( point, a, b, c, target );
  420. };
  421. Triangle.normal = function ( a, b, c, target ) {
  422. console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
  423. return Triangle.getNormal( a, b, c, target );
  424. };
  425. //
  426. Shape.prototype.extractAllPoints = function ( divisions ) {
  427. console.warn( 'THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.' );
  428. return this.extractPoints( divisions );
  429. };
  430. Shape.prototype.extrude = function ( options ) {
  431. console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' );
  432. return new ExtrudeGeometry( this, options );
  433. };
  434. Shape.prototype.makeGeometry = function ( options ) {
  435. console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' );
  436. return new ShapeGeometry( this, options );
  437. };
  438. //
  439. Vector2.prototype.fromAttribute = function ( attribute, index, offset ) {
  440. console.warn( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' );
  441. return this.fromBufferAttribute( attribute, index, offset );
  442. };
  443. Vector2.prototype.distanceToManhattan = function ( v ) {
  444. console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
  445. return this.manhattanDistanceTo( v );
  446. };
  447. Vector2.prototype.lengthManhattan = function () {
  448. console.warn( 'THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().' );
  449. return this.manhattanLength();
  450. };
  451. //
  452. Vector3.prototype.setEulerFromRotationMatrix = function () {
  453. console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' );
  454. };
  455. Vector3.prototype.setEulerFromQuaternion = function () {
  456. console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' );
  457. };
  458. Vector3.prototype.getPositionFromMatrix = function ( m ) {
  459. console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' );
  460. return this.setFromMatrixPosition( m );
  461. };
  462. Vector3.prototype.getScaleFromMatrix = function ( m ) {
  463. console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' );
  464. return this.setFromMatrixScale( m );
  465. };
  466. Vector3.prototype.getColumnFromMatrix = function ( index, matrix ) {
  467. console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' );
  468. return this.setFromMatrixColumn( matrix, index );
  469. };
  470. Vector3.prototype.applyProjection = function ( m ) {
  471. console.warn( 'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.' );
  472. return this.applyMatrix4( m );
  473. };
  474. Vector3.prototype.fromAttribute = function ( attribute, index, offset ) {
  475. console.warn( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' );
  476. return this.fromBufferAttribute( attribute, index, offset );
  477. };
  478. Vector3.prototype.distanceToManhattan = function ( v ) {
  479. console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
  480. return this.manhattanDistanceTo( v );
  481. };
  482. Vector3.prototype.lengthManhattan = function () {
  483. console.warn( 'THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().' );
  484. return this.manhattanLength();
  485. };
  486. //
  487. Vector4.prototype.fromAttribute = function ( attribute, index, offset ) {
  488. console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );
  489. return this.fromBufferAttribute( attribute, index, offset );
  490. };
  491. Vector4.prototype.lengthManhattan = function () {
  492. console.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' );
  493. return this.manhattanLength();
  494. };
  495. //
  496. Object3D.prototype.getChildByName = function ( name ) {
  497. console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
  498. return this.getObjectByName( name );
  499. };
  500. Object3D.prototype.renderDepth = function () {
  501. console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' );
  502. };
  503. Object3D.prototype.translate = function ( distance, axis ) {
  504. console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
  505. return this.translateOnAxis( axis, distance );
  506. };
  507. Object3D.prototype.getWorldRotation = function () {
  508. console.error( 'THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.' );
  509. };
  510. Object3D.prototype.applyMatrix = function ( matrix ) {
  511. console.warn( 'THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().' );
  512. return this.applyMatrix4( matrix );
  513. };
  514. Object.defineProperties( Object3D.prototype, {
  515. eulerOrder: {
  516. get: function () {
  517. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  518. return this.rotation.order;
  519. },
  520. set: function ( value ) {
  521. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  522. this.rotation.order = value;
  523. }
  524. },
  525. useQuaternion: {
  526. get: function () {
  527. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  528. },
  529. set: function () {
  530. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  531. }
  532. }
  533. } );
  534. Mesh.prototype.setDrawMode = function () {
  535. console.error( 'THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' );
  536. };
  537. Object.defineProperties( Mesh.prototype, {
  538. drawMode: {
  539. get: function () {
  540. console.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.' );
  541. return TrianglesDrawMode;
  542. },
  543. set: function () {
  544. console.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' );
  545. }
  546. }
  547. } );
  548. SkinnedMesh.prototype.initBones = function () {
  549. console.error( 'THREE.SkinnedMesh: initBones() has been removed.' );
  550. };
  551. //
  552. PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {
  553. console.warn( 'THREE.PerspectiveCamera.setLens is deprecated. ' +
  554. 'Use .setFocalLength and .filmGauge for a photographic setup.' );
  555. if ( filmGauge !== undefined ) this.filmGauge = filmGauge;
  556. this.setFocalLength( focalLength );
  557. };
  558. //
  559. Object.defineProperties( Light.prototype, {
  560. onlyShadow: {
  561. set: function () {
  562. console.warn( 'THREE.Light: .onlyShadow has been removed.' );
  563. }
  564. },
  565. shadowCameraFov: {
  566. set: function ( value ) {
  567. console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' );
  568. this.shadow.camera.fov = value;
  569. }
  570. },
  571. shadowCameraLeft: {
  572. set: function ( value ) {
  573. console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' );
  574. this.shadow.camera.left = value;
  575. }
  576. },
  577. shadowCameraRight: {
  578. set: function ( value ) {
  579. console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' );
  580. this.shadow.camera.right = value;
  581. }
  582. },
  583. shadowCameraTop: {
  584. set: function ( value ) {
  585. console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' );
  586. this.shadow.camera.top = value;
  587. }
  588. },
  589. shadowCameraBottom: {
  590. set: function ( value ) {
  591. console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' );
  592. this.shadow.camera.bottom = value;
  593. }
  594. },
  595. shadowCameraNear: {
  596. set: function ( value ) {
  597. console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' );
  598. this.shadow.camera.near = value;
  599. }
  600. },
  601. shadowCameraFar: {
  602. set: function ( value ) {
  603. console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' );
  604. this.shadow.camera.far = value;
  605. }
  606. },
  607. shadowCameraVisible: {
  608. set: function () {
  609. console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' );
  610. }
  611. },
  612. shadowBias: {
  613. set: function ( value ) {
  614. console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' );
  615. this.shadow.bias = value;
  616. }
  617. },
  618. shadowDarkness: {
  619. set: function () {
  620. console.warn( 'THREE.Light: .shadowDarkness has been removed.' );
  621. }
  622. },
  623. shadowMapWidth: {
  624. set: function ( value ) {
  625. console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' );
  626. this.shadow.mapSize.width = value;
  627. }
  628. },
  629. shadowMapHeight: {
  630. set: function ( value ) {
  631. console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' );
  632. this.shadow.mapSize.height = value;
  633. }
  634. }
  635. } );
  636. //
  637. Object.defineProperties( BufferAttribute.prototype, {
  638. length: {
  639. get: function () {
  640. console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' );
  641. return this.array.length;
  642. }
  643. },
  644. dynamic: {
  645. get: function () {
  646. console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
  647. return this.usage === DynamicDrawUsage;
  648. },
  649. set: function ( /* value */ ) {
  650. console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
  651. this.setUsage( DynamicDrawUsage );
  652. }
  653. }
  654. } );
  655. BufferAttribute.prototype.setDynamic = function ( value ) {
  656. console.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.' );
  657. this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
  658. return this;
  659. };
  660. BufferAttribute.prototype.copyIndicesArray = function ( /* indices */ ) {
  661. console.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' );
  662. },
  663. BufferAttribute.prototype.setArray = function ( /* array */ ) {
  664. console.error( 'THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );
  665. };
  666. //
  667. BufferGeometry.prototype.addIndex = function ( index ) {
  668. console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
  669. this.setIndex( index );
  670. };
  671. BufferGeometry.prototype.addAttribute = function ( name, attribute ) {
  672. console.warn( 'THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().' );
  673. if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) {
  674. console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
  675. return this.setAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );
  676. }
  677. if ( name === 'index' ) {
  678. console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
  679. this.setIndex( attribute );
  680. return this;
  681. }
  682. return this.setAttribute( name, attribute );
  683. };
  684. BufferGeometry.prototype.addDrawCall = function ( start, count, indexOffset ) {
  685. if ( indexOffset !== undefined ) {
  686. console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
  687. }
  688. console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
  689. this.addGroup( start, count );
  690. };
  691. BufferGeometry.prototype.clearDrawCalls = function () {
  692. console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
  693. this.clearGroups();
  694. };
  695. BufferGeometry.prototype.computeOffsets = function () {
  696. console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
  697. };
  698. BufferGeometry.prototype.removeAttribute = function ( name ) {
  699. console.warn( 'THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().' );
  700. return this.deleteAttribute( name );
  701. };
  702. BufferGeometry.prototype.applyMatrix = function ( matrix ) {
  703. console.warn( 'THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().' );
  704. return this.applyMatrix4( matrix );
  705. };
  706. Object.defineProperties( BufferGeometry.prototype, {
  707. drawcalls: {
  708. get: function () {
  709. console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
  710. return this.groups;
  711. }
  712. },
  713. offsets: {
  714. get: function () {
  715. console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
  716. return this.groups;
  717. }
  718. }
  719. } );
  720. InterleavedBuffer.prototype.setDynamic = function ( value ) {
  721. console.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.' );
  722. this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
  723. return this;
  724. };
  725. InterleavedBuffer.prototype.setArray = function ( /* array */ ) {
  726. console.error( 'THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );
  727. };
  728. //
  729. ExtrudeGeometry.prototype.getArrays = function () {
  730. console.error( 'THREE.ExtrudeGeometry: .getArrays() has been removed.' );
  731. };
  732. ExtrudeGeometry.prototype.addShapeList = function () {
  733. console.error( 'THREE.ExtrudeGeometry: .addShapeList() has been removed.' );
  734. };
  735. ExtrudeGeometry.prototype.addShape = function () {
  736. console.error( 'THREE.ExtrudeGeometry: .addShape() has been removed.' );
  737. };
  738. //
  739. Scene.prototype.dispose = function () {
  740. console.error( 'THREE.Scene: .dispose() has been removed.' );
  741. };
  742. //
  743. Uniform.prototype.onUpdate = function () {
  744. console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' );
  745. return this;
  746. };
  747. //
  748. Object.defineProperties( Material.prototype, {
  749. wrapAround: {
  750. get: function () {
  751. console.warn( 'THREE.Material: .wrapAround has been removed.' );
  752. },
  753. set: function () {
  754. console.warn( 'THREE.Material: .wrapAround has been removed.' );
  755. }
  756. },
  757. overdraw: {
  758. get: function () {
  759. console.warn( 'THREE.Material: .overdraw has been removed.' );
  760. },
  761. set: function () {
  762. console.warn( 'THREE.Material: .overdraw has been removed.' );
  763. }
  764. },
  765. wrapRGB: {
  766. get: function () {
  767. console.warn( 'THREE.Material: .wrapRGB has been removed.' );
  768. return new Color();
  769. }
  770. },
  771. shading: {
  772. get: function () {
  773. console.error( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
  774. },
  775. set: function ( value ) {
  776. console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
  777. this.flatShading = ( value === FlatShading );
  778. }
  779. },
  780. stencilMask: {
  781. get: function () {
  782. console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );
  783. return this.stencilFuncMask;
  784. },
  785. set: function ( value ) {
  786. console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );
  787. this.stencilFuncMask = value;
  788. }
  789. }
  790. } );
  791. Object.defineProperties( ShaderMaterial.prototype, {
  792. derivatives: {
  793. get: function () {
  794. console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  795. return this.extensions.derivatives;
  796. },
  797. set: function ( value ) {
  798. console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  799. this.extensions.derivatives = value;
  800. }
  801. }
  802. } );
  803. //
  804. WebGLRenderer.prototype.clearTarget = function ( renderTarget, color, depth, stencil ) {
  805. console.warn( 'THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.' );
  806. this.setRenderTarget( renderTarget );
  807. this.clear( color, depth, stencil );
  808. };
  809. WebGLRenderer.prototype.animate = function ( callback ) {
  810. console.warn( 'THREE.WebGLRenderer: .animate() is now .setAnimationLoop().' );
  811. this.setAnimationLoop( callback );
  812. };
  813. WebGLRenderer.prototype.getCurrentRenderTarget = function () {
  814. console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' );
  815. return this.getRenderTarget();
  816. };
  817. WebGLRenderer.prototype.getMaxAnisotropy = function () {
  818. console.warn( 'THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().' );
  819. return this.capabilities.getMaxAnisotropy();
  820. };
  821. WebGLRenderer.prototype.getPrecision = function () {
  822. console.warn( 'THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.' );
  823. return this.capabilities.precision;
  824. };
  825. WebGLRenderer.prototype.resetGLState = function () {
  826. console.warn( 'THREE.WebGLRenderer: .resetGLState() is now .state.reset().' );
  827. return this.state.reset();
  828. };
  829. WebGLRenderer.prototype.supportsFloatTextures = function () {
  830. console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' );
  831. return this.extensions.get( 'OES_texture_float' );
  832. };
  833. WebGLRenderer.prototype.supportsHalfFloatTextures = function () {
  834. console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' );
  835. return this.extensions.get( 'OES_texture_half_float' );
  836. };
  837. WebGLRenderer.prototype.supportsStandardDerivatives = function () {
  838. console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' );
  839. return this.extensions.get( 'OES_standard_derivatives' );
  840. };
  841. WebGLRenderer.prototype.supportsCompressedTextureS3TC = function () {
  842. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' );
  843. return this.extensions.get( 'WEBGL_compressed_texture_s3tc' );
  844. };
  845. WebGLRenderer.prototype.supportsCompressedTexturePVRTC = function () {
  846. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' );
  847. return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );
  848. };
  849. WebGLRenderer.prototype.supportsBlendMinMax = function () {
  850. console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' );
  851. return this.extensions.get( 'EXT_blend_minmax' );
  852. };
  853. WebGLRenderer.prototype.supportsVertexTextures = function () {
  854. console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );
  855. return this.capabilities.vertexTextures;
  856. };
  857. WebGLRenderer.prototype.supportsInstancedArrays = function () {
  858. console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' );
  859. return this.extensions.get( 'ANGLE_instanced_arrays' );
  860. };
  861. WebGLRenderer.prototype.enableScissorTest = function ( boolean ) {
  862. console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
  863. this.setScissorTest( boolean );
  864. };
  865. WebGLRenderer.prototype.initMaterial = function () {
  866. console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
  867. };
  868. WebGLRenderer.prototype.addPrePlugin = function () {
  869. console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
  870. };
  871. WebGLRenderer.prototype.addPostPlugin = function () {
  872. console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
  873. };
  874. WebGLRenderer.prototype.updateShadowMap = function () {
  875. console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
  876. };
  877. WebGLRenderer.prototype.setFaceCulling = function () {
  878. console.warn( 'THREE.WebGLRenderer: .setFaceCulling() has been removed.' );
  879. };
  880. WebGLRenderer.prototype.allocTextureUnit = function () {
  881. console.warn( 'THREE.WebGLRenderer: .allocTextureUnit() has been removed.' );
  882. };
  883. WebGLRenderer.prototype.setTexture = function () {
  884. console.warn( 'THREE.WebGLRenderer: .setTexture() has been removed.' );
  885. };
  886. WebGLRenderer.prototype.setTexture2D = function () {
  887. console.warn( 'THREE.WebGLRenderer: .setTexture2D() has been removed.' );
  888. };
  889. WebGLRenderer.prototype.setTextureCube = function () {
  890. console.warn( 'THREE.WebGLRenderer: .setTextureCube() has been removed.' );
  891. };
  892. WebGLRenderer.prototype.getActiveMipMapLevel = function () {
  893. console.warn( 'THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().' );
  894. return this.getActiveMipmapLevel();
  895. };
  896. Object.defineProperties( WebGLRenderer.prototype, {
  897. shadowMapEnabled: {
  898. get: function () {
  899. return this.shadowMap.enabled;
  900. },
  901. set: function ( value ) {
  902. console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );
  903. this.shadowMap.enabled = value;
  904. }
  905. },
  906. shadowMapType: {
  907. get: function () {
  908. return this.shadowMap.type;
  909. },
  910. set: function ( value ) {
  911. console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );
  912. this.shadowMap.type = value;
  913. }
  914. },
  915. shadowMapCullFace: {
  916. get: function () {
  917. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' );
  918. return undefined;
  919. },
  920. set: function ( /* value */ ) {
  921. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' );
  922. }
  923. },
  924. context: {
  925. get: function () {
  926. console.warn( 'THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.' );
  927. return this.getContext();
  928. }
  929. },
  930. vr: {
  931. get: function () {
  932. console.warn( 'THREE.WebGLRenderer: .vr has been renamed to .xr' );
  933. return this.xr;
  934. }
  935. },
  936. gammaInput: {
  937. get: function () {
  938. console.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' );
  939. return false;
  940. },
  941. set: function () {
  942. console.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' );
  943. }
  944. },
  945. gammaOutput: {
  946. get: function () {
  947. console.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' );
  948. return false;
  949. },
  950. set: function ( value ) {
  951. console.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' );
  952. this.outputEncoding = ( value === true ) ? sRGBEncoding : LinearEncoding;
  953. }
  954. },
  955. toneMappingWhitePoint: {
  956. get: function () {
  957. console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );
  958. return 1.0;
  959. },
  960. set: function () {
  961. console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );
  962. }
  963. },
  964. } );
  965. Object.defineProperties( WebGLShadowMap.prototype, {
  966. cullFace: {
  967. get: function () {
  968. console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' );
  969. return undefined;
  970. },
  971. set: function ( /* cullFace */ ) {
  972. console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' );
  973. }
  974. },
  975. renderReverseSided: {
  976. get: function () {
  977. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' );
  978. return undefined;
  979. },
  980. set: function () {
  981. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' );
  982. }
  983. },
  984. renderSingleSided: {
  985. get: function () {
  986. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' );
  987. return undefined;
  988. },
  989. set: function () {
  990. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' );
  991. }
  992. }
  993. } );
  994. export function WebGLRenderTargetCube( width, height, options ) {
  995. console.warn( 'THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).' );
  996. return new WebGLCubeRenderTarget( width, options );
  997. }
  998. //
  999. Object.defineProperties( WebGLRenderTarget.prototype, {
  1000. wrapS: {
  1001. get: function () {
  1002. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  1003. return this.texture.wrapS;
  1004. },
  1005. set: function ( value ) {
  1006. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  1007. this.texture.wrapS = value;
  1008. }
  1009. },
  1010. wrapT: {
  1011. get: function () {
  1012. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  1013. return this.texture.wrapT;
  1014. },
  1015. set: function ( value ) {
  1016. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  1017. this.texture.wrapT = value;
  1018. }
  1019. },
  1020. magFilter: {
  1021. get: function () {
  1022. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  1023. return this.texture.magFilter;
  1024. },
  1025. set: function ( value ) {
  1026. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  1027. this.texture.magFilter = value;
  1028. }
  1029. },
  1030. minFilter: {
  1031. get: function () {
  1032. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  1033. return this.texture.minFilter;
  1034. },
  1035. set: function ( value ) {
  1036. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  1037. this.texture.minFilter = value;
  1038. }
  1039. },
  1040. anisotropy: {
  1041. get: function () {
  1042. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  1043. return this.texture.anisotropy;
  1044. },
  1045. set: function ( value ) {
  1046. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  1047. this.texture.anisotropy = value;
  1048. }
  1049. },
  1050. offset: {
  1051. get: function () {
  1052. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  1053. return this.texture.offset;
  1054. },
  1055. set: function ( value ) {
  1056. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  1057. this.texture.offset = value;
  1058. }
  1059. },
  1060. repeat: {
  1061. get: function () {
  1062. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  1063. return this.texture.repeat;
  1064. },
  1065. set: function ( value ) {
  1066. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  1067. this.texture.repeat = value;
  1068. }
  1069. },
  1070. format: {
  1071. get: function () {
  1072. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  1073. return this.texture.format;
  1074. },
  1075. set: function ( value ) {
  1076. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  1077. this.texture.format = value;
  1078. }
  1079. },
  1080. type: {
  1081. get: function () {
  1082. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  1083. return this.texture.type;
  1084. },
  1085. set: function ( value ) {
  1086. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  1087. this.texture.type = value;
  1088. }
  1089. },
  1090. generateMipmaps: {
  1091. get: function () {
  1092. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  1093. return this.texture.generateMipmaps;
  1094. },
  1095. set: function ( value ) {
  1096. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  1097. this.texture.generateMipmaps = value;
  1098. }
  1099. }
  1100. } );
  1101. //
  1102. Audio.prototype.load = function ( file ) {
  1103. console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
  1104. const scope = this;
  1105. const audioLoader = new AudioLoader();
  1106. audioLoader.load( file, function ( buffer ) {
  1107. scope.setBuffer( buffer );
  1108. } );
  1109. return this;
  1110. };
  1111. AudioAnalyser.prototype.getData = function () {
  1112. console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
  1113. return this.getFrequencyData();
  1114. };
  1115. //
  1116. CubeCamera.prototype.updateCubeMap = function ( renderer, scene ) {
  1117. console.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' );
  1118. return this.update( renderer, scene );
  1119. };
  1120. CubeCamera.prototype.clear = function ( renderer, color, depth, stencil ) {
  1121. console.warn( 'THREE.CubeCamera: .clear() is now .renderTarget.clear().' );
  1122. return this.renderTarget.clear( renderer, color, depth, stencil );
  1123. };
  1124. ImageUtils.crossOrigin = undefined;
  1125. ImageUtils.loadTexture = function ( url, mapping, onLoad, onError ) {
  1126. console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );
  1127. const loader = new TextureLoader();
  1128. loader.setCrossOrigin( this.crossOrigin );
  1129. const texture = loader.load( url, onLoad, undefined, onError );
  1130. if ( mapping ) texture.mapping = mapping;
  1131. return texture;
  1132. };
  1133. ImageUtils.loadTextureCube = function ( urls, mapping, onLoad, onError ) {
  1134. console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );
  1135. const loader = new CubeTextureLoader();
  1136. loader.setCrossOrigin( this.crossOrigin );
  1137. const texture = loader.load( urls, onLoad, undefined, onError );
  1138. if ( mapping ) texture.mapping = mapping;
  1139. return texture;
  1140. };
  1141. ImageUtils.loadCompressedTexture = function () {
  1142. console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
  1143. };
  1144. ImageUtils.loadCompressedTextureCube = function () {
  1145. console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
  1146. };
  1147. //
  1148. export function CanvasRenderer() {
  1149. console.error( 'THREE.CanvasRenderer has been removed' );
  1150. }
  1151. //
  1152. export function JSONLoader() {
  1153. console.error( 'THREE.JSONLoader has been removed.' );
  1154. }
  1155. //
  1156. export const SceneUtils = {
  1157. createMultiMaterialObject: function ( /* geometry, materials */ ) {
  1158. console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );
  1159. },
  1160. detach: function ( /* child, parent, scene */ ) {
  1161. console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );
  1162. },
  1163. attach: function ( /* child, scene, parent */ ) {
  1164. console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );
  1165. }
  1166. };
  1167. //
  1168. export function LensFlare() {
  1169. console.error( 'THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js' );
  1170. }
粤ICP备19079148号