Three.Legacy.js 52 KB

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