2
0

Three.Legacy.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518
  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. } );
  663. Object.defineProperties( MeshPhongMaterial.prototype, {
  664. metal: {
  665. get: function () {
  666. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
  667. return false;
  668. },
  669. set: function () {
  670. console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' );
  671. }
  672. }
  673. } );
  674. Object.defineProperties( ShaderMaterial.prototype, {
  675. derivatives: {
  676. get: function () {
  677. console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  678. return this.extensions.derivatives;
  679. },
  680. set: function ( value ) {
  681. console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
  682. this.extensions.derivatives = value;
  683. }
  684. }
  685. } );
  686. //
  687. Object.assign( WebGLRenderer.prototype, {
  688. getCurrentRenderTarget: function () {
  689. console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' );
  690. return this.getRenderTarget();
  691. },
  692. supportsFloatTextures: function () {
  693. console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' );
  694. return this.extensions.get( 'OES_texture_float' );
  695. },
  696. supportsHalfFloatTextures: function () {
  697. console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' );
  698. return this.extensions.get( 'OES_texture_half_float' );
  699. },
  700. supportsStandardDerivatives: function () {
  701. console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' );
  702. return this.extensions.get( 'OES_standard_derivatives' );
  703. },
  704. supportsCompressedTextureS3TC: function () {
  705. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' );
  706. return this.extensions.get( 'WEBGL_compressed_texture_s3tc' );
  707. },
  708. supportsCompressedTexturePVRTC: function () {
  709. console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' );
  710. return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );
  711. },
  712. supportsBlendMinMax: function () {
  713. console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' );
  714. return this.extensions.get( 'EXT_blend_minmax' );
  715. },
  716. supportsVertexTextures: function () {
  717. console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' );
  718. return this.capabilities.vertexTextures;
  719. },
  720. supportsInstancedArrays: function () {
  721. console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' );
  722. return this.extensions.get( 'ANGLE_instanced_arrays' );
  723. },
  724. enableScissorTest: function ( boolean ) {
  725. console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );
  726. this.setScissorTest( boolean );
  727. },
  728. initMaterial: function () {
  729. console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );
  730. },
  731. addPrePlugin: function () {
  732. console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );
  733. },
  734. addPostPlugin: function () {
  735. console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );
  736. },
  737. updateShadowMap: function () {
  738. console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
  739. }
  740. } );
  741. Object.defineProperties( WebGLRenderer.prototype, {
  742. shadowMapEnabled: {
  743. get: function () {
  744. return this.shadowMap.enabled;
  745. },
  746. set: function ( value ) {
  747. console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );
  748. this.shadowMap.enabled = value;
  749. }
  750. },
  751. shadowMapType: {
  752. get: function () {
  753. return this.shadowMap.type;
  754. },
  755. set: function ( value ) {
  756. console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );
  757. this.shadowMap.type = value;
  758. }
  759. },
  760. shadowMapCullFace: {
  761. get: function () {
  762. return this.shadowMap.cullFace;
  763. },
  764. set: function ( value ) {
  765. console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' );
  766. this.shadowMap.cullFace = value;
  767. }
  768. }
  769. } );
  770. Object.defineProperties( WebGLShadowMap.prototype, {
  771. cullFace: {
  772. get: function () {
  773. return this.renderReverseSided ? CullFaceFront : CullFaceBack;
  774. },
  775. set: function ( cullFace ) {
  776. var value = ( cullFace !== CullFaceBack );
  777. console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." );
  778. this.renderReverseSided = value;
  779. }
  780. }
  781. } );
  782. //
  783. Object.defineProperties( WebGLRenderTarget.prototype, {
  784. wrapS: {
  785. get: function () {
  786. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  787. return this.texture.wrapS;
  788. },
  789. set: function ( value ) {
  790. console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
  791. this.texture.wrapS = value;
  792. }
  793. },
  794. wrapT: {
  795. get: function () {
  796. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  797. return this.texture.wrapT;
  798. },
  799. set: function ( value ) {
  800. console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
  801. this.texture.wrapT = value;
  802. }
  803. },
  804. magFilter: {
  805. get: function () {
  806. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  807. return this.texture.magFilter;
  808. },
  809. set: function ( value ) {
  810. console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
  811. this.texture.magFilter = value;
  812. }
  813. },
  814. minFilter: {
  815. get: function () {
  816. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  817. return this.texture.minFilter;
  818. },
  819. set: function ( value ) {
  820. console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
  821. this.texture.minFilter = value;
  822. }
  823. },
  824. anisotropy: {
  825. get: function () {
  826. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  827. return this.texture.anisotropy;
  828. },
  829. set: function ( value ) {
  830. console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
  831. this.texture.anisotropy = value;
  832. }
  833. },
  834. offset: {
  835. get: function () {
  836. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  837. return this.texture.offset;
  838. },
  839. set: function ( value ) {
  840. console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
  841. this.texture.offset = value;
  842. }
  843. },
  844. repeat: {
  845. get: function () {
  846. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  847. return this.texture.repeat;
  848. },
  849. set: function ( value ) {
  850. console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
  851. this.texture.repeat = value;
  852. }
  853. },
  854. format: {
  855. get: function () {
  856. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  857. return this.texture.format;
  858. },
  859. set: function ( value ) {
  860. console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
  861. this.texture.format = value;
  862. }
  863. },
  864. type: {
  865. get: function () {
  866. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  867. return this.texture.type;
  868. },
  869. set: function ( value ) {
  870. console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
  871. this.texture.type = value;
  872. }
  873. },
  874. generateMipmaps: {
  875. get: function () {
  876. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  877. return this.texture.generateMipmaps;
  878. },
  879. set: function ( value ) {
  880. console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
  881. this.texture.generateMipmaps = value;
  882. }
  883. }
  884. } );
  885. //
  886. Audio.prototype.load = function ( file ) {
  887. console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
  888. var scope = this;
  889. var audioLoader = new AudioLoader();
  890. audioLoader.load( file, function ( buffer ) {
  891. scope.setBuffer( buffer );
  892. } );
  893. return this;
  894. };
  895. AudioAnalyser.prototype.getData = function () {
  896. console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );
  897. return this.getFrequencyData();
  898. };
  899. //
  900. export var GeometryUtils = {
  901. merge: function ( geometry1, geometry2, materialIndexOffset ) {
  902. console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
  903. var matrix;
  904. if ( geometry2.isMesh ) {
  905. geometry2.matrixAutoUpdate && geometry2.updateMatrix();
  906. matrix = geometry2.matrix;
  907. geometry2 = geometry2.geometry;
  908. }
  909. geometry1.merge( geometry2, matrix, materialIndexOffset );
  910. },
  911. center: function ( geometry ) {
  912. console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
  913. return geometry.center();
  914. }
  915. };
  916. export var ImageUtils = {
  917. crossOrigin: undefined,
  918. loadTexture: function ( url, mapping, onLoad, onError ) {
  919. console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );
  920. var loader = new TextureLoader();
  921. loader.setCrossOrigin( this.crossOrigin );
  922. var texture = loader.load( url, onLoad, undefined, onError );
  923. if ( mapping ) texture.mapping = mapping;
  924. return texture;
  925. },
  926. loadTextureCube: function ( urls, mapping, onLoad, onError ) {
  927. console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );
  928. var loader = new CubeTextureLoader();
  929. loader.setCrossOrigin( this.crossOrigin );
  930. var texture = loader.load( urls, onLoad, undefined, onError );
  931. if ( mapping ) texture.mapping = mapping;
  932. return texture;
  933. },
  934. loadCompressedTexture: function () {
  935. console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );
  936. },
  937. loadCompressedTextureCube: function () {
  938. console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );
  939. }
  940. };
  941. //
  942. export function Projector() {
  943. console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
  944. this.projectVector = function ( vector, camera ) {
  945. console.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
  946. vector.project( camera );
  947. };
  948. this.unprojectVector = function ( vector, camera ) {
  949. console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
  950. vector.unproject( camera );
  951. };
  952. this.pickingRay = function () {
  953. console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );
  954. };
  955. }
  956. //
  957. export function CanvasRenderer() {
  958. console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
  959. this.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
  960. this.clear = function () {};
  961. this.render = function () {};
  962. this.setClearColor = function () {};
  963. this.setSize = function () {};
  964. }