Three.Legacy.js 46 KB

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