Three.Legacy.js 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941
  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 { 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. MathUtils.random16 = function () {
  279. console.warn( 'THREE.Math: .random16() has been deprecated. Use Math.random() instead.' );
  280. return Math.random();
  281. };
  282. MathUtils.nearestPowerOfTwo = function ( value ) {
  283. console.warn( 'THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo().' );
  284. return MathUtils.floorPowerOfTwo( value );
  285. };
  286. MathUtils.nextPowerOfTwo = function ( value ) {
  287. console.warn( 'THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().' );
  288. return MathUtils.ceilPowerOfTwo( value );
  289. };
  290. //
  291. Matrix3.prototype.flattenToArrayOffset = function ( array, offset ) {
  292. console.warn( 'THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );
  293. return this.toArray( array, offset );
  294. };
  295. Matrix3.prototype.multiplyVector3 = function ( vector ) {
  296. console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' );
  297. return vector.applyMatrix3( this );
  298. };
  299. Matrix3.prototype.multiplyVector3Array = function ( /* a */ ) {
  300. console.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.' );
  301. };
  302. Matrix3.prototype.applyToBufferAttribute = function ( attribute ) {
  303. console.warn( 'THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.' );
  304. return attribute.applyMatrix3( this );
  305. };
  306. Matrix3.prototype.applyToVector3Array = function ( /* array, offset, length */ ) {
  307. console.error( 'THREE.Matrix3: .applyToVector3Array() has been removed.' );
  308. };
  309. Matrix3.prototype.getInverse = function ( matrix ) {
  310. console.warn( 'THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' );
  311. return this.copy( matrix ).invert();
  312. };
  313. //
  314. Matrix4.prototype.extractPosition = function ( m ) {
  315. console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' );
  316. return this.copyPosition( m );
  317. };
  318. Matrix4.prototype.flattenToArrayOffset = function ( array, offset ) {
  319. console.warn( 'THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );
  320. return this.toArray( array, offset );
  321. };
  322. Matrix4.prototype.getPosition = function () {
  323. console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' );
  324. return new Vector3().setFromMatrixColumn( this, 3 );
  325. };
  326. Matrix4.prototype.setRotationFromQuaternion = function ( q ) {
  327. console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );
  328. return this.makeRotationFromQuaternion( q );
  329. };
  330. Matrix4.prototype.multiplyToArray = function () {
  331. console.warn( 'THREE.Matrix4: .multiplyToArray() has been removed.' );
  332. };
  333. Matrix4.prototype.multiplyVector3 = function ( vector ) {
  334. console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  335. return vector.applyMatrix4( this );
  336. };
  337. Matrix4.prototype.multiplyVector4 = function ( vector ) {
  338. console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  339. return vector.applyMatrix4( this );
  340. };
  341. Matrix4.prototype.multiplyVector3Array = function ( /* a */ ) {
  342. console.error( 'THREE.Matrix4: .multiplyVector3Array() has been removed.' );
  343. };
  344. Matrix4.prototype.rotateAxis = function ( v ) {
  345. console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' );
  346. v.transformDirection( this );
  347. };
  348. Matrix4.prototype.crossVector = function ( vector ) {
  349. console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' );
  350. return vector.applyMatrix4( this );
  351. };
  352. Matrix4.prototype.translate = function () {
  353. console.error( 'THREE.Matrix4: .translate() has been removed.' );
  354. };
  355. Matrix4.prototype.rotateX = function () {
  356. console.error( 'THREE.Matrix4: .rotateX() has been removed.' );
  357. };
  358. Matrix4.prototype.rotateY = function () {
  359. console.error( 'THREE.Matrix4: .rotateY() has been removed.' );
  360. };
  361. Matrix4.prototype.rotateZ = function () {
  362. console.error( 'THREE.Matrix4: .rotateZ() has been removed.' );
  363. };
  364. Matrix4.prototype.rotateByAxis = function () {
  365. console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' );
  366. };
  367. Matrix4.prototype.applyToBufferAttribute = function ( attribute ) {
  368. console.warn( 'THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.' );
  369. return attribute.applyMatrix4( this );
  370. };
  371. Matrix4.prototype.applyToVector3Array = function ( /* array, offset, length */ ) {
  372. console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' );
  373. };
  374. Matrix4.prototype.makeFrustum = function ( left, right, bottom, top, near, far ) {
  375. console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' );
  376. return this.makePerspective( left, right, top, bottom, near, far );
  377. };
  378. Matrix4.prototype.getInverse = function ( matrix ) {
  379. console.warn( 'THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.' );
  380. return this.copy( matrix ).invert();
  381. };
  382. //
  383. Plane.prototype.isIntersectionLine = function ( line ) {
  384. console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' );
  385. return this.intersectsLine( line );
  386. };
  387. //
  388. Quaternion.prototype.multiplyVector3 = function ( vector ) {
  389. console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' );
  390. return vector.applyQuaternion( this );
  391. };
  392. Quaternion.prototype.inverse = function ( ) {
  393. console.warn( 'THREE.Quaternion: .inverse() has been renamed to invert().' );
  394. return this.invert();
  395. };
  396. //
  397. Ray.prototype.isIntersectionBox = function ( box ) {
  398. console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );
  399. return this.intersectsBox( box );
  400. };
  401. Ray.prototype.isIntersectionPlane = function ( plane ) {
  402. console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );
  403. return this.intersectsPlane( plane );
  404. };
  405. Ray.prototype.isIntersectionSphere = function ( sphere ) {
  406. console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );
  407. return this.intersectsSphere( sphere );
  408. };
  409. //
  410. Triangle.prototype.area = function () {
  411. console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' );
  412. return this.getArea();
  413. };
  414. Triangle.prototype.barycoordFromPoint = function ( point, target ) {
  415. console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
  416. return this.getBarycoord( point, target );
  417. };
  418. Triangle.prototype.midpoint = function ( target ) {
  419. console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' );
  420. return this.getMidpoint( target );
  421. };
  422. Triangle.prototypenormal = function ( target ) {
  423. console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
  424. return this.getNormal( target );
  425. };
  426. Triangle.prototype.plane = function ( target ) {
  427. console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' );
  428. return this.getPlane( target );
  429. };
  430. Triangle.barycoordFromPoint = function ( point, a, b, c, target ) {
  431. console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
  432. return Triangle.getBarycoord( point, a, b, c, target );
  433. };
  434. Triangle.normal = function ( a, b, c, target ) {
  435. console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
  436. return Triangle.getNormal( a, b, c, target );
  437. };
  438. //
  439. Shape.prototype.extractAllPoints = function ( divisions ) {
  440. console.warn( 'THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.' );
  441. return this.extractPoints( divisions );
  442. };
  443. Shape.prototype.extrude = function ( options ) {
  444. console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' );
  445. return new ExtrudeGeometry( this, options );
  446. };
  447. Shape.prototype.makeGeometry = function ( options ) {
  448. console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' );
  449. return new ShapeGeometry( this, options );
  450. };
  451. //
  452. Vector2.prototype.fromAttribute = function ( attribute, index, offset ) {
  453. console.warn( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' );
  454. return this.fromBufferAttribute( attribute, index, offset );
  455. };
  456. Vector2.prototype.distanceToManhattan = function ( v ) {
  457. console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
  458. return this.manhattanDistanceTo( v );
  459. };
  460. Vector2.prototype.lengthManhattan = function () {
  461. console.warn( 'THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().' );
  462. return this.manhattanLength();
  463. };
  464. //
  465. Vector3.prototype.setEulerFromRotationMatrix = function () {
  466. console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' );
  467. };
  468. Vector3.prototype.setEulerFromQuaternion = function () {
  469. console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' );
  470. };
  471. Vector3.prototype.getPositionFromMatrix = function ( m ) {
  472. console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' );
  473. return this.setFromMatrixPosition( m );
  474. };
  475. Vector3.prototype.getScaleFromMatrix = function ( m ) {
  476. console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' );
  477. return this.setFromMatrixScale( m );
  478. };
  479. Vector3.prototype.getColumnFromMatrix = function ( index, matrix ) {
  480. console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' );
  481. return this.setFromMatrixColumn( matrix, index );
  482. };
  483. Vector3.prototype.applyProjection = function ( m ) {
  484. console.warn( 'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.' );
  485. return this.applyMatrix4( m );
  486. };
  487. Vector3.prototype.fromAttribute = function ( attribute, index, offset ) {
  488. console.warn( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' );
  489. return this.fromBufferAttribute( attribute, index, offset );
  490. };
  491. Vector3.prototype.distanceToManhattan = function ( v ) {
  492. console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
  493. return this.manhattanDistanceTo( v );
  494. };
  495. Vector3.prototype.lengthManhattan = function () {
  496. console.warn( 'THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().' );
  497. return this.manhattanLength();
  498. };
  499. //
  500. Vector4.prototype.fromAttribute = function ( attribute, index, offset ) {
  501. console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );
  502. return this.fromBufferAttribute( attribute, index, offset );
  503. };
  504. Vector4.prototype.lengthManhattan = function () {
  505. console.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' );
  506. return this.manhattanLength();
  507. };
  508. //
  509. Object3D.prototype.getChildByName = function ( name ) {
  510. console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
  511. return this.getObjectByName( name );
  512. };
  513. Object3D.prototype.renderDepth = function () {
  514. console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' );
  515. };
  516. Object3D.prototype.translate = function ( distance, axis ) {
  517. console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
  518. return this.translateOnAxis( axis, distance );
  519. };
  520. Object3D.prototype.getWorldRotation = function () {
  521. console.error( 'THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.' );
  522. };
  523. Object3D.prototype.applyMatrix = function ( matrix ) {
  524. console.warn( 'THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().' );
  525. return this.applyMatrix4( matrix );
  526. };
  527. Object.defineProperties( Object3D.prototype, {
  528. eulerOrder: {
  529. get: function () {
  530. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  531. return this.rotation.order;
  532. },
  533. set: function ( value ) {
  534. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  535. this.rotation.order = value;
  536. }
  537. },
  538. useQuaternion: {
  539. get: function () {
  540. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  541. },
  542. set: function () {
  543. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  544. }
  545. }
  546. } );
  547. Mesh.prototype.setDrawMode = function () {
  548. console.error( 'THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' );
  549. };
  550. Object.defineProperties( Mesh.prototype, {
  551. drawMode: {
  552. get: function () {
  553. console.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.' );
  554. return TrianglesDrawMode;
  555. },
  556. set: function () {
  557. console.error( 'THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.' );
  558. }
  559. }
  560. } );
  561. SkinnedMesh.prototype.initBones = function () {
  562. console.error( 'THREE.SkinnedMesh: initBones() has been removed.' );
  563. };
  564. //
  565. PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {
  566. console.warn( 'THREE.PerspectiveCamera.setLens is deprecated. ' +
  567. 'Use .setFocalLength and .filmGauge for a photographic setup.' );
  568. if ( filmGauge !== undefined ) this.filmGauge = filmGauge;
  569. this.setFocalLength( focalLength );
  570. };
  571. //
  572. Object.defineProperties( Light.prototype, {
  573. onlyShadow: {
  574. set: function () {
  575. console.warn( 'THREE.Light: .onlyShadow has been removed.' );
  576. }
  577. },
  578. shadowCameraFov: {
  579. set: function ( value ) {
  580. console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' );
  581. this.shadow.camera.fov = value;
  582. }
  583. },
  584. shadowCameraLeft: {
  585. set: function ( value ) {
  586. console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' );
  587. this.shadow.camera.left = value;
  588. }
  589. },
  590. shadowCameraRight: {
  591. set: function ( value ) {
  592. console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' );
  593. this.shadow.camera.right = value;
  594. }
  595. },
  596. shadowCameraTop: {
  597. set: function ( value ) {
  598. console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' );
  599. this.shadow.camera.top = value;
  600. }
  601. },
  602. shadowCameraBottom: {
  603. set: function ( value ) {
  604. console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' );
  605. this.shadow.camera.bottom = value;
  606. }
  607. },
  608. shadowCameraNear: {
  609. set: function ( value ) {
  610. console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' );
  611. this.shadow.camera.near = value;
  612. }
  613. },
  614. shadowCameraFar: {
  615. set: function ( value ) {
  616. console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' );
  617. this.shadow.camera.far = value;
  618. }
  619. },
  620. shadowCameraVisible: {
  621. set: function () {
  622. console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' );
  623. }
  624. },
  625. shadowBias: {
  626. set: function ( value ) {
  627. console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' );
  628. this.shadow.bias = value;
  629. }
  630. },
  631. shadowDarkness: {
  632. set: function () {
  633. console.warn( 'THREE.Light: .shadowDarkness has been removed.' );
  634. }
  635. },
  636. shadowMapWidth: {
  637. set: function ( value ) {
  638. console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' );
  639. this.shadow.mapSize.width = value;
  640. }
  641. },
  642. shadowMapHeight: {
  643. set: function ( value ) {
  644. console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' );
  645. this.shadow.mapSize.height = value;
  646. }
  647. }
  648. } );
  649. //
  650. Object.defineProperties( BufferAttribute.prototype, {
  651. length: {
  652. get: function () {
  653. console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' );
  654. return this.array.length;
  655. }
  656. },
  657. dynamic: {
  658. get: function () {
  659. console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
  660. return this.usage === DynamicDrawUsage;
  661. },
  662. set: function ( /* value */ ) {
  663. console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
  664. this.setUsage( DynamicDrawUsage );
  665. }
  666. }
  667. } );
  668. BufferAttribute.prototype.setDynamic = function ( value ) {
  669. console.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.' );
  670. this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
  671. return this;
  672. };
  673. BufferAttribute.prototype.copyIndicesArray = function ( /* indices */ ) {
  674. console.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' );
  675. },
  676. BufferAttribute.prototype.setArray = function ( /* array */ ) {
  677. console.error( 'THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );
  678. };
  679. //
  680. BufferGeometry.prototype.addIndex = function ( index ) {
  681. console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
  682. this.setIndex( index );
  683. };
  684. BufferGeometry.prototype.addAttribute = function ( name, attribute ) {
  685. console.warn( 'THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().' );
  686. if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) {
  687. console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
  688. return this.setAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );
  689. }
  690. if ( name === 'index' ) {
  691. console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
  692. this.setIndex( attribute );
  693. return this;
  694. }
  695. return this.setAttribute( name, attribute );
  696. };
  697. BufferGeometry.prototype.addDrawCall = function ( start, count, indexOffset ) {
  698. if ( indexOffset !== undefined ) {
  699. console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
  700. }
  701. console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
  702. this.addGroup( start, count );
  703. };
  704. BufferGeometry.prototype.clearDrawCalls = function () {
  705. console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
  706. this.clearGroups();
  707. };
  708. BufferGeometry.prototype.computeOffsets = function () {
  709. console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
  710. };
  711. BufferGeometry.prototype.removeAttribute = function ( name ) {
  712. console.warn( 'THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().' );
  713. return this.deleteAttribute( name );
  714. };
  715. BufferGeometry.prototype.applyMatrix = function ( matrix ) {
  716. console.warn( 'THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().' );
  717. return this.applyMatrix4( matrix );
  718. };
  719. Object.defineProperties( BufferGeometry.prototype, {
  720. drawcalls: {
  721. get: function () {
  722. console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
  723. return this.groups;
  724. }
  725. },
  726. offsets: {
  727. get: function () {
  728. console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
  729. return this.groups;
  730. }
  731. }
  732. } );
  733. InterleavedBuffer.prototype.setDynamic = function ( value ) {
  734. console.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.' );
  735. this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
  736. return this;
  737. };
  738. InterleavedBuffer.prototype.setArray = function ( /* array */ ) {
  739. console.error( 'THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );
  740. };
  741. //
  742. ExtrudeGeometry.prototype.getArrays = function () {
  743. console.error( 'THREE.ExtrudeGeometry: .getArrays() has been removed.' );
  744. };
  745. ExtrudeGeometry.prototype.addShapeList = function () {
  746. console.error( 'THREE.ExtrudeGeometry: .addShapeList() has been removed.' );
  747. };
  748. ExtrudeGeometry.prototype.addShape = function () {
  749. console.error( 'THREE.ExtrudeGeometry: .addShape() has been removed.' );
  750. };
  751. //
  752. Scene.prototype.dispose = function () {
  753. console.error( 'THREE.Scene: .dispose() has been removed.' );
  754. };
  755. //
  756. Uniform.prototype.onUpdate = function () {
  757. console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' );
  758. return this;
  759. };
  760. //
  761. Object.defineProperties( Material.prototype, {
  762. wrapAround: {
  763. get: function () {
  764. console.warn( 'THREE.Material: .wrapAround has been removed.' );
  765. },
  766. set: function () {
  767. console.warn( 'THREE.Material: .wrapAround has been removed.' );
  768. }
  769. },
  770. overdraw: {
  771. get: function () {
  772. console.warn( 'THREE.Material: .overdraw has been removed.' );
  773. },
  774. set: function () {
  775. console.warn( 'THREE.Material: .overdraw has been removed.' );
  776. }
  777. },
  778. wrapRGB: {
  779. get: function () {
  780. console.warn( 'THREE.Material: .wrapRGB has been removed.' );
  781. return new Color();
  782. }
  783. },
  784. shading: {
  785. get: function () {
  786. console.error( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
  787. },
  788. set: function ( value ) {
  789. console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
  790. this.flatShading = ( value === FlatShading );
  791. }
  792. },
  793. stencilMask: {
  794. get: function () {
  795. console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );
  796. return this.stencilFuncMask;
  797. },
  798. set: function ( value ) {
  799. console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );
  800. this.stencilFuncMask = value;
  801. }
  802. }
  803. } );
  804. Object.defineProperties( ShaderMaterial.prototype, {
  805. derivatives: {
  806. get: function () {
  807. console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  808. return this.extensions.derivatives;
  809. },
  810. set: function ( value ) {
  811. console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  812. this.extensions.derivatives = value;
  813. }
  814. }
  815. } );
  816. //
  817. WebGLRenderer.prototype.clearTarget = function ( renderTarget, color, depth, stencil ) {
  818. console.warn( 'THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.' );
  819. this.setRenderTarget( renderTarget );
  820. this.clear( color, depth, stencil );
  821. };
  822. WebGLRenderer.prototype.animate = function ( callback ) {
  823. console.warn( 'THREE.WebGLRenderer: .animate() is now .setAnimationLoop().' );
  824. this.setAnimationLoop( callback );
  825. };
  826. WebGLRenderer.prototype.getCurrentRenderTarget = function () {
  827. console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' );
  828. return this.getRenderTarget();
  829. };
  830. WebGLRenderer.prototype.getMaxAnisotropy = function () {
  831. console.warn( 'THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().' );
  832. return this.capabilities.getMaxAnisotropy();
  833. };
  834. WebGLRenderer.prototype.getPrecision = function () {
  835. console.warn( 'THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.' );
  836. return this.capabilities.precision;
  837. };
  838. WebGLRenderer.prototype.resetGLState = function () {
  839. console.warn( 'THREE.WebGLRenderer: .resetGLState() is now .state.reset().' );
  840. return this.state.reset();
  841. };
  842. WebGLRenderer.prototype.supportsFloatTextures = function () {
  843. console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' );
  844. return this.extensions.get( 'OES_texture_float' );
  845. };
  846. WebGLRenderer.prototype.supportsHalfFloatTextures = function () {
  847. console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' );
  848. return this.extensions.get( 'OES_texture_half_float' );
  849. };
  850. WebGLRenderer.prototype.supportsStandardDerivatives = function () {
  851. console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' );
  852. return this.extensions.get( 'OES_standard_derivatives' );
  853. };
  854. WebGLRenderer.prototype.supportsCompressedTextureS3TC = function () {
  855. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' );
  856. return this.extensions.get( 'WEBGL_compressed_texture_s3tc' );
  857. };
  858. WebGLRenderer.prototype.supportsCompressedTexturePVRTC = function () {
  859. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' );
  860. return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );
  861. };
  862. WebGLRenderer.prototype.supportsBlendMinMax = function () {
  863. console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' );
  864. return this.extensions.get( 'EXT_blend_minmax' );
  865. };
  866. WebGLRenderer.prototype.supportsVertexTextures = function () {
  867. console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );
  868. return this.capabilities.vertexTextures;
  869. };
  870. WebGLRenderer.prototype.supportsInstancedArrays = function () {
  871. console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' );
  872. return this.extensions.get( 'ANGLE_instanced_arrays' );
  873. };
  874. WebGLRenderer.prototype.enableScissorTest = function ( boolean ) {
  875. console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
  876. this.setScissorTest( boolean );
  877. };
  878. WebGLRenderer.prototype.initMaterial = function () {
  879. console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
  880. };
  881. WebGLRenderer.prototype.addPrePlugin = function () {
  882. console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
  883. };
  884. WebGLRenderer.prototype.addPostPlugin = function () {
  885. console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
  886. };
  887. WebGLRenderer.prototype.updateShadowMap = function () {
  888. console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
  889. };
  890. WebGLRenderer.prototype.setFaceCulling = function () {
  891. console.warn( 'THREE.WebGLRenderer: .setFaceCulling() has been removed.' );
  892. };
  893. WebGLRenderer.prototype.allocTextureUnit = function () {
  894. console.warn( 'THREE.WebGLRenderer: .allocTextureUnit() has been removed.' );
  895. };
  896. WebGLRenderer.prototype.setTexture = function () {
  897. console.warn( 'THREE.WebGLRenderer: .setTexture() has been removed.' );
  898. };
  899. WebGLRenderer.prototype.setTexture2D = function () {
  900. console.warn( 'THREE.WebGLRenderer: .setTexture2D() has been removed.' );
  901. };
  902. WebGLRenderer.prototype.setTextureCube = function () {
  903. console.warn( 'THREE.WebGLRenderer: .setTextureCube() has been removed.' );
  904. };
  905. WebGLRenderer.prototype.getActiveMipMapLevel = function () {
  906. console.warn( 'THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().' );
  907. return this.getActiveMipmapLevel();
  908. };
  909. Object.defineProperties( WebGLRenderer.prototype, {
  910. shadowMapEnabled: {
  911. get: function () {
  912. return this.shadowMap.enabled;
  913. },
  914. set: function ( value ) {
  915. console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );
  916. this.shadowMap.enabled = value;
  917. }
  918. },
  919. shadowMapType: {
  920. get: function () {
  921. return this.shadowMap.type;
  922. },
  923. set: function ( value ) {
  924. console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );
  925. this.shadowMap.type = value;
  926. }
  927. },
  928. shadowMapCullFace: {
  929. get: function () {
  930. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' );
  931. return undefined;
  932. },
  933. set: function ( /* value */ ) {
  934. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' );
  935. }
  936. },
  937. context: {
  938. get: function () {
  939. console.warn( 'THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.' );
  940. return this.getContext();
  941. }
  942. },
  943. vr: {
  944. get: function () {
  945. console.warn( 'THREE.WebGLRenderer: .vr has been renamed to .xr' );
  946. return this.xr;
  947. }
  948. },
  949. gammaInput: {
  950. get: function () {
  951. console.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' );
  952. return false;
  953. },
  954. set: function () {
  955. console.warn( 'THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.' );
  956. }
  957. },
  958. gammaOutput: {
  959. get: function () {
  960. console.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' );
  961. return false;
  962. },
  963. set: function ( value ) {
  964. console.warn( 'THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.' );
  965. this.outputEncoding = ( value === true ) ? sRGBEncoding : LinearEncoding;
  966. }
  967. },
  968. toneMappingWhitePoint: {
  969. get: function () {
  970. console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );
  971. return 1.0;
  972. },
  973. set: function () {
  974. console.warn( 'THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.' );
  975. }
  976. },
  977. } );
  978. Object.defineProperties( WebGLShadowMap.prototype, {
  979. cullFace: {
  980. get: function () {
  981. console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' );
  982. return undefined;
  983. },
  984. set: function ( /* cullFace */ ) {
  985. console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' );
  986. }
  987. },
  988. renderReverseSided: {
  989. get: function () {
  990. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' );
  991. return undefined;
  992. },
  993. set: function () {
  994. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' );
  995. }
  996. },
  997. renderSingleSided: {
  998. get: function () {
  999. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' );
  1000. return undefined;
  1001. },
  1002. set: function () {
  1003. console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' );
  1004. }
  1005. }
  1006. } );
  1007. export function WebGLRenderTargetCube( width, height, options ) {
  1008. console.warn( 'THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).' );
  1009. return new WebGLCubeRenderTarget( width, options );
  1010. }
  1011. //
  1012. Object.defineProperties( WebGLRenderTarget.prototype, {
  1013. wrapS: {
  1014. get: function () {
  1015. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  1016. return this.texture.wrapS;
  1017. },
  1018. set: function ( value ) {
  1019. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  1020. this.texture.wrapS = value;
  1021. }
  1022. },
  1023. wrapT: {
  1024. get: function () {
  1025. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  1026. return this.texture.wrapT;
  1027. },
  1028. set: function ( value ) {
  1029. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  1030. this.texture.wrapT = value;
  1031. }
  1032. },
  1033. magFilter: {
  1034. get: function () {
  1035. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  1036. return this.texture.magFilter;
  1037. },
  1038. set: function ( value ) {
  1039. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  1040. this.texture.magFilter = value;
  1041. }
  1042. },
  1043. minFilter: {
  1044. get: function () {
  1045. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  1046. return this.texture.minFilter;
  1047. },
  1048. set: function ( value ) {
  1049. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  1050. this.texture.minFilter = value;
  1051. }
  1052. },
  1053. anisotropy: {
  1054. get: function () {
  1055. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  1056. return this.texture.anisotropy;
  1057. },
  1058. set: function ( value ) {
  1059. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  1060. this.texture.anisotropy = value;
  1061. }
  1062. },
  1063. offset: {
  1064. get: function () {
  1065. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  1066. return this.texture.offset;
  1067. },
  1068. set: function ( value ) {
  1069. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  1070. this.texture.offset = value;
  1071. }
  1072. },
  1073. repeat: {
  1074. get: function () {
  1075. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  1076. return this.texture.repeat;
  1077. },
  1078. set: function ( value ) {
  1079. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  1080. this.texture.repeat = value;
  1081. }
  1082. },
  1083. format: {
  1084. get: function () {
  1085. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  1086. return this.texture.format;
  1087. },
  1088. set: function ( value ) {
  1089. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  1090. this.texture.format = value;
  1091. }
  1092. },
  1093. type: {
  1094. get: function () {
  1095. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  1096. return this.texture.type;
  1097. },
  1098. set: function ( value ) {
  1099. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  1100. this.texture.type = value;
  1101. }
  1102. },
  1103. generateMipmaps: {
  1104. get: function () {
  1105. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  1106. return this.texture.generateMipmaps;
  1107. },
  1108. set: function ( value ) {
  1109. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  1110. this.texture.generateMipmaps = value;
  1111. }
  1112. }
  1113. } );
  1114. //
  1115. Audio.prototype.load = function ( file ) {
  1116. console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
  1117. const scope = this;
  1118. const audioLoader = new AudioLoader();
  1119. audioLoader.load( file, function ( buffer ) {
  1120. scope.setBuffer( buffer );
  1121. } );
  1122. return this;
  1123. };
  1124. AudioAnalyser.prototype.getData = function () {
  1125. console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
  1126. return this.getFrequencyData();
  1127. };
  1128. //
  1129. CubeCamera.prototype.updateCubeMap = function ( renderer, scene ) {
  1130. console.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' );
  1131. return this.update( renderer, scene );
  1132. };
  1133. CubeCamera.prototype.clear = function ( renderer, color, depth, stencil ) {
  1134. console.warn( 'THREE.CubeCamera: .clear() is now .renderTarget.clear().' );
  1135. return this.renderTarget.clear( renderer, color, depth, stencil );
  1136. };
  1137. ImageUtils.crossOrigin = undefined;
  1138. ImageUtils.loadTexture = function ( url, mapping, onLoad, onError ) {
  1139. console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );
  1140. const loader = new TextureLoader();
  1141. loader.setCrossOrigin( this.crossOrigin );
  1142. const texture = loader.load( url, onLoad, undefined, onError );
  1143. if ( mapping ) texture.mapping = mapping;
  1144. return texture;
  1145. };
  1146. ImageUtils.loadTextureCube = function ( urls, mapping, onLoad, onError ) {
  1147. console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );
  1148. const loader = new CubeTextureLoader();
  1149. loader.setCrossOrigin( this.crossOrigin );
  1150. const texture = loader.load( urls, onLoad, undefined, onError );
  1151. if ( mapping ) texture.mapping = mapping;
  1152. return texture;
  1153. };
  1154. ImageUtils.loadCompressedTexture = function () {
  1155. console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
  1156. };
  1157. ImageUtils.loadCompressedTextureCube = function () {
  1158. console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
  1159. };
  1160. //
  1161. export function CanvasRenderer() {
  1162. console.error( 'THREE.CanvasRenderer has been removed' );
  1163. }
  1164. //
  1165. export function JSONLoader() {
  1166. console.error( 'THREE.JSONLoader has been removed.' );
  1167. }
  1168. //
  1169. export const SceneUtils = {
  1170. createMultiMaterialObject: function ( /* geometry, materials */ ) {
  1171. console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );
  1172. },
  1173. detach: function ( /* child, parent, scene */ ) {
  1174. console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );
  1175. },
  1176. attach: function ( /* child, scene, parent */ ) {
  1177. console.error( 'THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js' );
  1178. }
  1179. };
  1180. //
  1181. export function LensFlare() {
  1182. console.error( 'THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js' );
  1183. }