Three.Legacy.js 41 KB

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