feat: initialize project with core dependencies and game entry point
This commit is contained in:
29
node_modules/three/examples/jsm/transpiler/TranspilerUtils.js
generated
vendored
Normal file
29
node_modules/three/examples/jsm/transpiler/TranspilerUtils.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
export function isExpression( st ) {
|
||||
|
||||
return st.isFunctionDeclaration !== true && st.isFor !== true && st.isWhile !== true && st.isConditional !== true && st.isSwitch !== true && st.isStructDefinition !== true;
|
||||
|
||||
}
|
||||
|
||||
export function isPrimitive( value ) {
|
||||
|
||||
return /^(true|false|-?(\d|\.\d))/.test( value );
|
||||
|
||||
}
|
||||
|
||||
export function isBuiltinType( str ) {
|
||||
|
||||
return /^(void|bool|float|u?int|mat[234]|mat[234]x[234]|(u|i|b)?vec[234])$/.test( str );
|
||||
|
||||
}
|
||||
|
||||
export function toFloatType( type ) {
|
||||
|
||||
if ( /^(i?int)$/.test( type ) ) return 'float';
|
||||
|
||||
const vecMatch = /^(i|u)?vec([234])$/.exec( type );
|
||||
|
||||
if ( vecMatch ) return 'vec' + vecMatch[ 2 ];
|
||||
|
||||
return type;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user