Three.Legacy.js 49 KB

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