Three.Legacy.js 45 KB

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