Three.Legacy.js 53 KB

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