Three.Legacy.js 41 KB

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