Three.Legacy.js 49 KB

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