2
0

Three.Legacy.js 45 KB

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