1
0

Three.Legacy.js 52 KB

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