Three.Legacy.js 37 KB

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