Update globe files
This commit is contained in:
12
src/modules/globe/beam/utils/getFilter.js
Executable file
12
src/modules/globe/beam/utils/getFilter.js
Executable file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* compute filtering enum, return one of the following :
|
||||
* NEAREST
|
||||
* LINEAR
|
||||
* NEAREST_MIPMAP_NEAREST
|
||||
* LINEAR_MIPMAP_NEAREST
|
||||
* NEAREST_MIPMAP_LINEAR
|
||||
* LINEAR_MIPMAP_LINEAR
|
||||
*/
|
||||
export default function getFilter( smooth, mipmap, miplinear ){
|
||||
return 0x2600 | (+smooth) | (+mipmap<<8) | ( +( mipmap && miplinear )<<1 );
|
||||
}
|
||||
3
src/modules/globe/beam/utils/isPowerOf2.js
Executable file
3
src/modules/globe/beam/utils/isPowerOf2.js
Executable file
@@ -0,0 +1,3 @@
|
||||
export default function isPowerOf2(value) {
|
||||
return (value & (value - 1)) == 0;
|
||||
}
|
||||
20
src/modules/globe/beam/utils/uuid.js
Executable file
20
src/modules/globe/beam/utils/uuid.js
Executable file
@@ -0,0 +1,20 @@
|
||||
// http://www.broofa.com/Tools/Math.uuid.htm
|
||||
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split( '' );
|
||||
var uuid = new Array( 36 );
|
||||
var rnd = 0, r;
|
||||
|
||||
export default function generateUUID() {
|
||||
for ( var i = 0; i < 36; i ++ ) {
|
||||
if ( i === 8 || i === 13 || i === 18 || i === 23 ) {
|
||||
uuid[ i ] = '-';
|
||||
} else if ( i === 14 ) {
|
||||
uuid[ i ] = '4';
|
||||
} else {
|
||||
if ( rnd <= 0x02 ) rnd = 0x2000000 + ( Math.random() * 0x1000000 ) | 0;
|
||||
r = rnd & 0xf;
|
||||
rnd = rnd >> 4;
|
||||
uuid[ i ] = chars[ ( i === 19 ) ? ( r & 0x3 ) | 0x8 : r ];
|
||||
}
|
||||
}
|
||||
return uuid.join( '' );
|
||||
}
|
||||
3
src/modules/globe/beam/utils/warn.js
Executable file
3
src/modules/globe/beam/utils/warn.js
Executable file
@@ -0,0 +1,3 @@
|
||||
export default function warn(msg, ctx){
|
||||
console.log("%c" + "[warn]: " + msg, "color:#ff0084", ctx );
|
||||
}
|
||||
Reference in New Issue
Block a user