Three.Legacy.js 38 KB

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