Update globe files

This commit is contained in:
2021-10-02 20:33:41 +02:00
parent 2dc1393dc2
commit 717d100d76
34 changed files with 97 additions and 105 deletions

View 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 );
}

View File

@@ -0,0 +1,3 @@
export default function isPowerOf2(value) {
return (value & (value - 1)) == 0;
}

View 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( '' );
}

View File

@@ -0,0 +1,3 @@
export default function warn(msg, ctx){
console.log("%c" + "[warn]: " + msg, "color:#ff0084", ctx );
}