Three.Legacy.js 47 KB

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