Three.Legacy.js 43 KB

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