Three.Legacy.js 43 KB

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