Three.Legacy.js 39 KB

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