Line.js 808 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. THREE.Line = function ( geometry, material, type ) {
  5. THREE.Object3D.call( this );
  6. this.geometry = geometry;
  7. this.material = ( material !== undefined ) ? material : new THREE.LineBasicMaterial( { color: Math.random() * 0xffffff } );
  8. this.type = ( type !== undefined ) ? type : THREE.LineStrip;
  9. if ( this.geometry ) {
  10. if ( ! this.geometry.boundingSphere ) {
  11. this.geometry.computeBoundingSphere();
  12. }
  13. }
  14. };
  15. THREE.LineStrip = 0;
  16. THREE.LinePieces = 1;
  17. THREE.Line.prototype = Object.create( THREE.Object3D.prototype );
  18. THREE.Line.prototype.clone = function ( object ) {
  19. if ( object === undefined ) object = new THREE.Line( this.geometry, this.material, this.type );
  20. THREE.Object3D.prototype.clone.call( this, object );
  21. return object;
  22. };
粤ICP备19079148号