File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,11 @@ Object.assign(pc, function () {
26
26
} ;
27
27
28
28
if ( url . load . startsWith ( 'blob:' ) ) {
29
- options . responseType = pc . Http . ResponseType . JSON ;
29
+ if ( pc . path . getExtension ( url . original ) . toLowerCase ( ) === '.glb' ) {
30
+ options . responseType = pc . Http . ResponseType . ARRAY_BUFFER ;
31
+ } else {
32
+ options . responseType = pc . Http . ResponseType . JSON ;
33
+ }
30
34
}
31
35
32
36
pc . http . get ( url . load , options , function ( err , response ) {
@@ -39,7 +43,7 @@ Object.assign(pc, function () {
39
43
} ,
40
44
41
45
open : function ( url , data ) {
42
- if ( pc . path . getExtension ( url ) === '.glb' ) {
46
+ if ( pc . path . getExtension ( url ) . toLowerCase ( ) === '.glb' ) {
43
47
var glb = pc . GlbParser . parse ( "filename.glb" , data , null ) ;
44
48
if ( ! glb ) {
45
49
return null ;
Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ Object.assign(pc, function () {
46
46
} ;
47
47
48
48
if ( url . load . startsWith ( 'blob:' ) ) {
49
- options . responseType = pc . Http . ResponseType . JSON ;
49
+ if ( pc . path . getExtension ( url . original ) . toLowerCase ( ) === '.glb' ) {
50
+ options . responseType = pc . Http . ResponseType . ARRAY_BUFFER ;
51
+ } else {
52
+ options . responseType = pc . Http . ResponseType . JSON ;
53
+ }
50
54
}
51
55
52
56
pc . http . get ( url . load , options , function ( err , response ) {
You can’t perform that action at this time.
0 commit comments