Three.Legacy.js 38 KB

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