Three.Legacy.js 46 KB

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