Three.Legacy.js 61 KB

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