Three.Legacy.js 38 KB

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