Three.Legacy.js 48 KB

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