@@ -21881,18 +21881,19 @@
21881
21881
try {
21882
21882
21883
21883
var texture = renderTarget.texture;
21884
+ var textureFormat = texture.format;
21885
+ var textureType = texture.type;
21884
21886
21885
- if ( texture.format !== RGBAFormat && paramThreeToGL( texture.format ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
21887
+ if ( textureFormat !== RGBAFormat && paramThreeToGL( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
21886
21888
21887
21889
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
21888
21890
return;
21889
21891
21890
21892
}
21891
21893
21892
- if ( texture.type !== UnsignedByteType &&
21893
- paramThreeToGL( texture.type ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) &&
21894
- ! ( texture.type === FloatType && extensions.get( 'WEBGL_color_buffer_float' ) ) &&
21895
- ! ( texture.type === HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) {
21894
+ if ( textureType !== UnsignedByteType && paramThreeToGL( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513)
21895
+ ! ( textureType === FloatType && ( extensions.get( 'OES_texture_float' ) || extensions.get( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox
21896
+ ! ( textureType === HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) {
21896
21897
21897
21898
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
21898
21899
return;
21905
21906
21906
21907
if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {
21907
21908
21908
- _gl.readPixels( x, y, width, height, paramThreeToGL( texture.format ), paramThreeToGL( texture.type ), buffer );
21909
+ _gl.readPixels( x, y, width, height, paramThreeToGL( textureFormat ), paramThreeToGL( textureType ), buffer );
21909
21910
21910
21911
}
21911
21912
@@ -38576,62 +38577,42 @@
38576
38577
CylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
38577
38578
CylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry;
38578
38579
38579
- /**
38580
- * @author WestLangley / http://github.com/WestLangley
38581
- * @author zz85 / http://github.com/zz85
38582
- * @author bhouston / http://clara.io
38583
- *
38584
- * Creates an arrow for visualizing directions
38585
- *
38586
- * Parameters:
38587
- * dir - Vector3
38588
- * origin - Vector3
38589
- * length - Number
38590
- * color - color in hex value
38591
- * headLength - Number
38592
- * headWidth - Number
38593
- */
38594
-
38595
- exports.ArrowHelper = ( function () {
38596
-
38597
- var lineGeometry = new BufferGeometry();
38598
- lineGeometry.addAttribute( 'position', new Float32Attribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
38599
-
38600
- var coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );
38601
- coneGeometry.translate( 0, - 0.5, 0 );
38580
+ var lineGeometry = new BufferGeometry();
38581
+ lineGeometry.addAttribute( 'position', new Float32Attribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
38602
38582
38603
- return function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
38583
+ var coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );
38584
+ coneGeometry.translate( 0, - 0.5, 0 );
38604
38585
38605
- // dir is assumed to be normalized
38586
+ function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
38606
38587
38607
- Object3D.call( this );
38588
+ // dir is assumed to be normalized
38608
38589
38609
- if ( color === undefined ) color = 0xffff00;
38610
- if ( length === undefined ) length = 1;
38611
- if ( headLength === undefined ) headLength = 0.2 * length;
38612
- if ( headWidth === undefined ) headWidth = 0.2 * headLength;
38590
+ Object3D.call( this );
38613
38591
38614
- this.position.copy( origin );
38592
+ if ( color === undefined ) color = 0xffff00;
38593
+ if ( length === undefined ) length = 1;
38594
+ if ( headLength === undefined ) headLength = 0.2 * length;
38595
+ if ( headWidth === undefined ) headWidth = 0.2 * headLength;
38615
38596
38616
- this.line = new Line( lineGeometry, new LineBasicMaterial( { color: color } ) );
38617
- this.line.matrixAutoUpdate = false;
38618
- this.add( this.line );
38597
+ this.position.copy( origin );
38619
38598
38620
- this.cone = new Mesh( coneGeometry , new MeshBasicMaterial ( { color: color } ) );
38621
- this.cone .matrixAutoUpdate = false;
38622
- this.add( this.cone );
38599
+ this.line = new Line( lineGeometry , new LineBasicMaterial ( { color: color } ) );
38600
+ this.line .matrixAutoUpdate = false;
38601
+ this.add( this.line );
38623
38602
38624
- this.setDirection( dir );
38625
- this.setLength( length, headLength, headWidth );
38603
+ this.cone = new Mesh( coneGeometry, new MeshBasicMaterial( { color: color } ) );
38604
+ this.cone.matrixAutoUpdate = false;
38605
+ this.add( this.cone );
38626
38606
38627
- };
38607
+ this.setDirection( dir );
38608
+ this.setLength( length, headLength, headWidth );
38628
38609
38629
- }() );
38610
+ }
38630
38611
38631
- exports. ArrowHelper.prototype = Object.create( Object3D.prototype );
38632
- exports. ArrowHelper.prototype.constructor = exports. ArrowHelper;
38612
+ ArrowHelper.prototype = Object.create( Object3D.prototype );
38613
+ ArrowHelper.prototype.constructor = ArrowHelper;
38633
38614
38634
- exports. ArrowHelper.prototype.setDirection = ( function () {
38615
+ ArrowHelper.prototype.setDirection = ( function () {
38635
38616
38636
38617
var axis = new Vector3();
38637
38618
var radians;
38662
38643
38663
38644
}() );
38664
38645
38665
- exports. ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) {
38646
+ ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) {
38666
38647
38667
38648
if ( headLength === undefined ) headLength = 0.2 * length;
38668
38649
if ( headWidth === undefined ) headWidth = 0.2 * headLength;
38676
38657
38677
38658
};
38678
38659
38679
- exports. ArrowHelper.prototype.setColor = function ( color ) {
38660
+ ArrowHelper.prototype.setColor = function ( color ) {
38680
38661
38681
38662
this.line.material.color.copy( color );
38682
38663
this.cone.material.color.copy( color );
41469
41450
exports.CameraHelper = CameraHelper;
41470
41451
exports.BoundingBoxHelper = BoundingBoxHelper;
41471
41452
exports.BoxHelper = BoxHelper;
41453
+ exports.ArrowHelper = ArrowHelper;
41472
41454
exports.AxisHelper = AxisHelper;
41473
41455
exports.WireframeGeometry = WireframeGeometry;
41474
41456
exports.ParametricGeometry = ParametricGeometry;
0 commit comments