Three.Legacy.js 55 KB

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