Three.Legacy.js 46 KB

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