Three.Legacy.js 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724
  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 { CullFaceFront, CullFaceBack, 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. Geometry.prototype.computeTangents = function () {
  522. console.warn( 'THREE.Geometry: .computeTangents() has been removed.' );
  523. };
  524. Object.assign( Object3D.prototype, {
  525. getChildByName: function ( name ) {
  526. console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
  527. return this.getObjectByName( name );
  528. },
  529. renderDepth: function () {
  530. console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' );
  531. },
  532. translate: function ( distance, axis ) {
  533. console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
  534. return this.translateOnAxis( axis, distance );
  535. }
  536. } );
  537. Object.defineProperties( Object3D.prototype, {
  538. eulerOrder: {
  539. get: function () {
  540. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  541. return this.rotation.order;
  542. },
  543. set: function ( value ) {
  544. console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
  545. this.rotation.order = value;
  546. }
  547. },
  548. useQuaternion: {
  549. get: function () {
  550. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  551. },
  552. set: function () {
  553. console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
  554. }
  555. }
  556. } );
  557. Object.defineProperties( LOD.prototype, {
  558. objects: {
  559. get: function () {
  560. console.warn( 'THREE.LOD: .objects has been renamed to .levels.' );
  561. return this.levels;
  562. }
  563. }
  564. } );
  565. Object.defineProperty( Skeleton.prototype, 'useVertexTexture', {
  566. get: function () {
  567. console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' );
  568. },
  569. set: function () {
  570. console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' );
  571. }
  572. } );
  573. Object.defineProperty( Curve.prototype, '__arcLengthDivisions', {
  574. get: function () {
  575. console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' );
  576. return this.arcLengthDivisions;
  577. },
  578. set: function ( value ) {
  579. console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' );
  580. this.arcLengthDivisions = value;
  581. }
  582. } );
  583. //
  584. PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {
  585. console.warn( "THREE.PerspectiveCamera.setLens is deprecated. " +
  586. "Use .setFocalLength and .filmGauge for a photographic setup." );
  587. if ( filmGauge !== undefined ) this.filmGauge = filmGauge;
  588. this.setFocalLength( focalLength );
  589. };
  590. //
  591. Object.defineProperties( Light.prototype, {
  592. onlyShadow: {
  593. set: function () {
  594. console.warn( 'THREE.Light: .onlyShadow has been removed.' );
  595. }
  596. },
  597. shadowCameraFov: {
  598. set: function ( value ) {
  599. console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' );
  600. this.shadow.camera.fov = value;
  601. }
  602. },
  603. shadowCameraLeft: {
  604. set: function ( value ) {
  605. console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' );
  606. this.shadow.camera.left = value;
  607. }
  608. },
  609. shadowCameraRight: {
  610. set: function ( value ) {
  611. console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' );
  612. this.shadow.camera.right = value;
  613. }
  614. },
  615. shadowCameraTop: {
  616. set: function ( value ) {
  617. console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' );
  618. this.shadow.camera.top = value;
  619. }
  620. },
  621. shadowCameraBottom: {
  622. set: function ( value ) {
  623. console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' );
  624. this.shadow.camera.bottom = value;
  625. }
  626. },
  627. shadowCameraNear: {
  628. set: function ( value ) {
  629. console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' );
  630. this.shadow.camera.near = value;
  631. }
  632. },
  633. shadowCameraFar: {
  634. set: function ( value ) {
  635. console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' );
  636. this.shadow.camera.far = value;
  637. }
  638. },
  639. shadowCameraVisible: {
  640. set: function () {
  641. console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' );
  642. }
  643. },
  644. shadowBias: {
  645. set: function ( value ) {
  646. console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' );
  647. this.shadow.bias = value;
  648. }
  649. },
  650. shadowDarkness: {
  651. set: function () {
  652. console.warn( 'THREE.Light: .shadowDarkness has been removed.' );
  653. }
  654. },
  655. shadowMapWidth: {
  656. set: function ( value ) {
  657. console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' );
  658. this.shadow.mapSize.width = value;
  659. }
  660. },
  661. shadowMapHeight: {
  662. set: function ( value ) {
  663. console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' );
  664. this.shadow.mapSize.height = value;
  665. }
  666. }
  667. } );
  668. //
  669. Object.defineProperties( BufferAttribute.prototype, {
  670. length: {
  671. get: function () {
  672. console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' );
  673. return this.array.length;
  674. }
  675. }
  676. } );
  677. Object.assign( BufferGeometry.prototype, {
  678. addIndex: function ( index ) {
  679. console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
  680. this.setIndex( index );
  681. },
  682. addDrawCall: function ( start, count, indexOffset ) {
  683. if ( indexOffset !== undefined ) {
  684. console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
  685. }
  686. console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
  687. this.addGroup( start, count );
  688. },
  689. clearDrawCalls: function () {
  690. console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
  691. this.clearGroups();
  692. },
  693. computeTangents: function () {
  694. console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' );
  695. },
  696. computeOffsets: function () {
  697. console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
  698. }
  699. } );
  700. Object.defineProperties( BufferGeometry.prototype, {
  701. drawcalls: {
  702. get: function () {
  703. console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
  704. return this.groups;
  705. }
  706. },
  707. offsets: {
  708. get: function () {
  709. console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
  710. return this.groups;
  711. }
  712. }
  713. } );
  714. //
  715. Object.defineProperties( Uniform.prototype, {
  716. dynamic: {
  717. set: function () {
  718. console.warn( 'THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.' );
  719. }
  720. },
  721. onUpdate: {
  722. value: function () {
  723. console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' );
  724. return this;
  725. }
  726. }
  727. } );
  728. //
  729. Object.defineProperties( Material.prototype, {
  730. wrapAround: {
  731. get: function () {
  732. console.warn( 'THREE.Material: .wrapAround has been removed.' );
  733. },
  734. set: function () {
  735. console.warn( 'THREE.Material: .wrapAround has been removed.' );
  736. }
  737. },
  738. wrapRGB: {
  739. get: function () {
  740. console.warn( 'THREE.Material: .wrapRGB has been removed.' );
  741. return new Color();
  742. }
  743. },
  744. shading: {
  745. get: function () {
  746. console.error( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
  747. },
  748. set: function ( value ) {
  749. console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
  750. this.flatShading = ( value === FlatShading );
  751. }
  752. }
  753. } );
  754. Object.defineProperties( MeshPhongMaterial.prototype, {
  755. metal: {
  756. get: function () {
  757. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
  758. return false;
  759. },
  760. set: function () {
  761. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' );
  762. }
  763. }
  764. } );
  765. Object.defineProperties( ShaderMaterial.prototype, {
  766. derivatives: {
  767. get: function () {
  768. console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  769. return this.extensions.derivatives;
  770. },
  771. set: function ( value ) {
  772. console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  773. this.extensions.derivatives = value;
  774. }
  775. }
  776. } );
  777. //
  778. Object.assign( WebGLRenderer.prototype, {
  779. getCurrentRenderTarget: function () {
  780. console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' );
  781. return this.getRenderTarget();
  782. },
  783. getMaxAnisotropy: function () {
  784. console.warn( 'THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().' );
  785. return this.capabilities.getMaxAnisotropy();
  786. },
  787. getPrecision: function () {
  788. console.warn( 'THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.' );
  789. return this.capabilities.precision;
  790. },
  791. resetGLState: function () {
  792. console.warn( 'THREE.WebGLRenderer: .resetGLState() is now .state.reset().' );
  793. return this.state.reset();
  794. },
  795. supportsFloatTextures: function () {
  796. console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' );
  797. return this.extensions.get( 'OES_texture_float' );
  798. },
  799. supportsHalfFloatTextures: function () {
  800. console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' );
  801. return this.extensions.get( 'OES_texture_half_float' );
  802. },
  803. supportsStandardDerivatives: function () {
  804. console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' );
  805. return this.extensions.get( 'OES_standard_derivatives' );
  806. },
  807. supportsCompressedTextureS3TC: function () {
  808. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' );
  809. return this.extensions.get( 'WEBGL_compressed_texture_s3tc' );
  810. },
  811. supportsCompressedTexturePVRTC: function () {
  812. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' );
  813. return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );
  814. },
  815. supportsBlendMinMax: function () {
  816. console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' );
  817. return this.extensions.get( 'EXT_blend_minmax' );
  818. },
  819. supportsVertexTextures: function () {
  820. console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );
  821. return this.capabilities.vertexTextures;
  822. },
  823. supportsInstancedArrays: function () {
  824. console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' );
  825. return this.extensions.get( 'ANGLE_instanced_arrays' );
  826. },
  827. enableScissorTest: function ( boolean ) {
  828. console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
  829. this.setScissorTest( boolean );
  830. },
  831. initMaterial: function () {
  832. console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
  833. },
  834. addPrePlugin: function () {
  835. console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
  836. },
  837. addPostPlugin: function () {
  838. console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
  839. },
  840. updateShadowMap: function () {
  841. console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
  842. }
  843. } );
  844. Object.defineProperties( WebGLRenderer.prototype, {
  845. shadowMapEnabled: {
  846. get: function () {
  847. return this.shadowMap.enabled;
  848. },
  849. set: function ( value ) {
  850. console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );
  851. this.shadowMap.enabled = value;
  852. }
  853. },
  854. shadowMapType: {
  855. get: function () {
  856. return this.shadowMap.type;
  857. },
  858. set: function ( value ) {
  859. console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );
  860. this.shadowMap.type = value;
  861. }
  862. },
  863. shadowMapCullFace: {
  864. get: function () {
  865. return this.shadowMap.cullFace;
  866. },
  867. set: function ( value ) {
  868. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' );
  869. this.shadowMap.cullFace = value;
  870. }
  871. }
  872. } );
  873. Object.defineProperties( WebGLShadowMap.prototype, {
  874. cullFace: {
  875. get: function () {
  876. return this.renderReverseSided ? CullFaceFront : CullFaceBack;
  877. },
  878. set: function ( cullFace ) {
  879. var value = ( cullFace !== CullFaceBack );
  880. console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." );
  881. this.renderReverseSided = value;
  882. }
  883. }
  884. } );
  885. //
  886. Object.defineProperties( WebGLRenderTarget.prototype, {
  887. wrapS: {
  888. get: function () {
  889. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  890. return this.texture.wrapS;
  891. },
  892. set: function ( value ) {
  893. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  894. this.texture.wrapS = value;
  895. }
  896. },
  897. wrapT: {
  898. get: function () {
  899. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  900. return this.texture.wrapT;
  901. },
  902. set: function ( value ) {
  903. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  904. this.texture.wrapT = value;
  905. }
  906. },
  907. magFilter: {
  908. get: function () {
  909. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  910. return this.texture.magFilter;
  911. },
  912. set: function ( value ) {
  913. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  914. this.texture.magFilter = value;
  915. }
  916. },
  917. minFilter: {
  918. get: function () {
  919. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  920. return this.texture.minFilter;
  921. },
  922. set: function ( value ) {
  923. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  924. this.texture.minFilter = value;
  925. }
  926. },
  927. anisotropy: {
  928. get: function () {
  929. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  930. return this.texture.anisotropy;
  931. },
  932. set: function ( value ) {
  933. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  934. this.texture.anisotropy = value;
  935. }
  936. },
  937. offset: {
  938. get: function () {
  939. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  940. return this.texture.offset;
  941. },
  942. set: function ( value ) {
  943. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  944. this.texture.offset = value;
  945. }
  946. },
  947. repeat: {
  948. get: function () {
  949. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  950. return this.texture.repeat;
  951. },
  952. set: function ( value ) {
  953. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  954. this.texture.repeat = value;
  955. }
  956. },
  957. format: {
  958. get: function () {
  959. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  960. return this.texture.format;
  961. },
  962. set: function ( value ) {
  963. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  964. this.texture.format = value;
  965. }
  966. },
  967. type: {
  968. get: function () {
  969. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  970. return this.texture.type;
  971. },
  972. set: function ( value ) {
  973. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  974. this.texture.type = value;
  975. }
  976. },
  977. generateMipmaps: {
  978. get: function () {
  979. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  980. return this.texture.generateMipmaps;
  981. },
  982. set: function ( value ) {
  983. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  984. this.texture.generateMipmaps = value;
  985. }
  986. }
  987. } );
  988. //
  989. Object.assign( WebVRManager.prototype, {
  990. getStandingMatrix: function () {
  991. console.warn( 'THREE.WebVRManager: .getStandingMatrix() has been removed.' );
  992. }
  993. } );
  994. Object.defineProperties( WebVRManager.prototype, {
  995. standing: {
  996. set: function ( /* value */ ) {
  997. console.warn( 'THREE.WebVRManager: .standing has been removed.' );
  998. }
  999. }
  1000. } );
  1001. //
  1002. Audio.prototype.load = function ( file ) {
  1003. console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
  1004. var scope = this;
  1005. var audioLoader = new AudioLoader();
  1006. audioLoader.load( file, function ( buffer ) {
  1007. scope.setBuffer( buffer );
  1008. } );
  1009. return this;
  1010. };
  1011. AudioAnalyser.prototype.getData = function () {
  1012. console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
  1013. return this.getFrequencyData();
  1014. };
  1015. //
  1016. CubeCamera.prototype.updateCubeMap = function ( renderer, scene ) {
  1017. console.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' );
  1018. return this.update( renderer, scene );
  1019. };
  1020. //
  1021. export var GeometryUtils = {
  1022. merge: function ( geometry1, geometry2, materialIndexOffset ) {
  1023. console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
  1024. var matrix;
  1025. if ( geometry2.isMesh ) {
  1026. geometry2.matrixAutoUpdate && geometry2.updateMatrix();
  1027. matrix = geometry2.matrix;
  1028. geometry2 = geometry2.geometry;
  1029. }
  1030. geometry1.merge( geometry2, matrix, materialIndexOffset );
  1031. },
  1032. center: function ( geometry ) {
  1033. console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
  1034. return geometry.center();
  1035. }
  1036. };
  1037. export var ImageUtils = {
  1038. crossOrigin: undefined,
  1039. loadTexture: function ( url, mapping, onLoad, onError ) {
  1040. console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );
  1041. var loader = new TextureLoader();
  1042. loader.setCrossOrigin( this.crossOrigin );
  1043. var texture = loader.load( url, onLoad, undefined, onError );
  1044. if ( mapping ) texture.mapping = mapping;
  1045. return texture;
  1046. },
  1047. loadTextureCube: function ( urls, mapping, onLoad, onError ) {
  1048. console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );
  1049. var loader = new CubeTextureLoader();
  1050. loader.setCrossOrigin( this.crossOrigin );
  1051. var texture = loader.load( urls, onLoad, undefined, onError );
  1052. if ( mapping ) texture.mapping = mapping;
  1053. return texture;
  1054. },
  1055. loadCompressedTexture: function () {
  1056. console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
  1057. },
  1058. loadCompressedTextureCube: function () {
  1059. console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
  1060. }
  1061. };
  1062. //
  1063. export function Projector() {
  1064. console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
  1065. this.projectVector = function ( vector, camera ) {
  1066. console.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
  1067. vector.project( camera );
  1068. };
  1069. this.unprojectVector = function ( vector, camera ) {
  1070. console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
  1071. vector.unproject( camera );
  1072. };
  1073. this.pickingRay = function () {
  1074. console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );
  1075. };
  1076. }
  1077. //
  1078. export function CanvasRenderer() {
  1079. console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
  1080. this.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
  1081. this.clear = function () {};
  1082. this.render = function () {};
  1083. this.setClearColor = function () {};
  1084. this.setSize = function () {};
  1085. }
粤ICP备19079148号