UNPKG

oxygen-core

Version:

Oxygen game engine (Xenon Core for browsers)

1,821 lines (1,820 loc) 10.5 MB
{ "type": "File", "start": 0, "end": 59189, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 2226, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 59189, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 2226, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 30, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 } }, "local": { "type": "Identifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 }, "identifierName": "System" }, "name": "System" } } ], "source": { "type": "StringLiteral", "start": 19, "end": 29, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 1, "column": 29 } }, "extra": { "rawValue": "./System", "raw": "'./System'" }, "value": "./System" } }, { "type": "ImportDeclaration", "start": 32, "end": 69, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 37 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 39, "end": 45, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "local": { "type": "Identifier", "start": 39, "end": 45, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 }, "identifierName": "Events" }, "name": "Events" } } ], "source": { "type": "StringLiteral", "start": 51, "end": 68, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 36 } }, "extra": { "rawValue": "../utils/Events", "raw": "'../utils/Events'" }, "value": "../utils/Events" } }, { "type": "ImportDeclaration", "start": 71, "end": 143, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 72 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 80, "end": 84, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 13 } }, "imported": { "type": "Identifier", "start": 80, "end": 84, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 13 }, "identifierName": "vec2" }, "name": "vec2" }, "local": { "type": "Identifier", "start": 80, "end": 84, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 13 }, "identifierName": "vec2" }, "name": "vec2" } }, { "type": "ImportSpecifier", "start": 86, "end": 90, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 19 } }, "imported": { "type": "Identifier", "start": 86, "end": 90, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 19 }, "identifierName": "vec3" }, "name": "vec3" }, "local": { "type": "Identifier", "start": 86, "end": 90, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 19 }, "identifierName": "vec3" }, "name": "vec3" } }, { "type": "ImportSpecifier", "start": 92, "end": 96, "loc": { "start": { "line": 3, "column": 21 }, "end": { "line": 3, "column": 25 } }, "imported": { "type": "Identifier", "start": 92, "end": 96, "loc": { "start": { "line": 3, "column": 21 }, "end": { "line": 3, "column": 25 }, "identifierName": "vec4" }, "name": "vec4" }, "local": { "type": "Identifier", "start": 92, "end": 96, "loc": { "start": { "line": 3, "column": 21 }, "end": { "line": 3, "column": 25 }, "identifierName": "vec4" }, "name": "vec4" } }, { "type": "ImportSpecifier", "start": 98, "end": 102, "loc": { "start": { "line": 3, "column": 27 }, "end": { "line": 3, "column": 31 } }, "imported": { "type": "Identifier", "start": 98, "end": 102, "loc": { "start": { "line": 3, "column": 27 }, "end": { "line": 3, "column": 31 }, "identifierName": "mat2" }, "name": "mat2" }, "local": { "type": "Identifier", "start": 98, "end": 102, "loc": { "start": { "line": 3, "column": 27 }, "end": { "line": 3, "column": 31 }, "identifierName": "mat2" }, "name": "mat2" } }, { "type": "ImportSpecifier", "start": 104, "end": 108, "loc": { "start": { "line": 3, "column": 33 }, "end": { "line": 3, "column": 37 } }, "imported": { "type": "Identifier", "start": 104, "end": 108, "loc": { "start": { "line": 3, "column": 33 }, "end": { "line": 3, "column": 37 }, "identifierName": "mat3" }, "name": "mat3" }, "local": { "type": "Identifier", "start": 104, "end": 108, "loc": { "start": { "line": 3, "column": 33 }, "end": { "line": 3, "column": 37 }, "identifierName": "mat3" }, "name": "mat3" } }, { "type": "ImportSpecifier", "start": 110, "end": 114, "loc": { "start": { "line": 3, "column": 39 }, "end": { "line": 3, "column": 43 } }, "imported": { "type": "Identifier", "start": 110, "end": 114, "loc": { "start": { "line": 3, "column": 39 }, "end": { "line": 3, "column": 43 }, "identifierName": "mat4" }, "name": "mat4" }, "local": { "type": "Identifier", "start": 110, "end": 114, "loc": { "start": { "line": 3, "column": 39 }, "end": { "line": 3, "column": 43 }, "identifierName": "mat4" }, "name": "mat4" } } ], "source": { "type": "StringLiteral", "start": 122, "end": 142, "loc": { "start": { "line": 3, "column": 51 }, "end": { "line": 3, "column": 71 } }, "extra": { "rawValue": "../utils/gl-matrix", "raw": "'../utils/gl-matrix'" }, "value": "../utils/gl-matrix" } }, { "type": "ImportDeclaration", "start": 145, "end": 202, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 57 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 154, "end": 159, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 14 } }, "imported": { "type": "Identifier", "start": 154, "end": 159, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 14 }, "identifierName": "isPOT" }, "name": "isPOT" }, "local": { "type": "Identifier", "start": 154, "end": 159, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 14 }, "identifierName": "isPOT" }, "name": "isPOT" } }, { "type": "ImportSpecifier", "start": 161, "end": 167, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 22 } }, "imported": { "type": "Identifier", "start": 161, "end": 167, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 22 }, "identifierName": "getPOT" }, "name": "getPOT" }, "local": { "type": "Identifier", "start": 161, "end": 167, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 22 }, "identifierName": "getPOT" }, "name": "getPOT" } }, { "type": "ImportSpecifier", "start": 169, "end": 183, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 38 } }, "imported": { "type": "Identifier", "start": 169, "end": 183, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 38 }, "identifierName": "getMipmapScale" }, "name": "getMipmapScale" }, "local": { "type": "Identifier", "start": 169, "end": 183, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 38 }, "identifierName": "getMipmapScale" }, "name": "getMipmapScale" } } ], "source": { "type": "StringLiteral", "start": 191, "end": 201, "loc": { "start": { "line": 4, "column": 46 }, "end": { "line": 4, "column": 56 } }, "extra": { "rawValue": "../utils", "raw": "'../utils'" }, "value": "../utils" } }, { "type": "ImportDeclaration", "start": 204, "end": 249, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 45 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 211, "end": 221, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 17 } }, "local": { "type": "Identifier", "start": 211, "end": 221, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 17 }, "identifierName": "funcParser" }, "name": "funcParser" } } ], "source": { "type": "StringLiteral", "start": 227, "end": 248, "loc": { "start": { "line": 5, "column": 23 }, "end": { "line": 5, "column": 44 } }, "extra": { "rawValue": "../utils/funcParser", "raw": "'../utils/funcParser'" }, "value": "../utils/funcParser" } }, { "type": "VariableDeclaration", "start": 253, "end": 277, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 24 } }, "declarations": [ { "type": "VariableDeclarator", "start": 257, "end": 276, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 23 } }, "id": { "type": "Identifier", "start": 257, "end": 272, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 19 }, "identifierName": "rtwUidGenerator" }, "name": "rtwUidGenerator" }, "init": { "type": "NumericLiteral", "start": 275, "end": 276, "loc": { "start": { "line": 7, "column": 22 }, "end": { "line": 7, "column": 23 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } } ], "kind": "let" }, { "type": "VariableDeclaration", "start": 281, "end": 435, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 13, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 287, "end": 434, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 13, "column": 1 } }, "id": { "type": "Identifier", "start": 287, "end": 295, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 9, "column": 14 }, "identifierName": "versions" }, "name": "versions" }, "init": { "type": "ArrayExpression", "start": 298, "end": 434, "loc": { "start": { "line": 9, "column": 17 }, "end": { "line": 13, "column": 1 } }, "elements": [ { "type": "ArrayExpression", "start": 400, "end": 412, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 14 } }, "elements": [ { "type": "NumericLiteral", "start": 401, "end": 402, "loc": { "start": { "line": 11, "column": 3 }, "end": { "line": 11, "column": 4 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1, "leadingComments": null }, { "type": "StringLiteral", "start": 404, "end": 411, "loc": { "start": { "line": 11, "column": 6 }, "end": { "line": 11, "column": 13 } }, "extra": { "rawValue": "webgl", "raw": "'webgl'" }, "value": "webgl" } ], "leadingComments": [ { "type": "CommentLine", "value": " TODO: change order to provide fallback to previous versions if requested is not supported.", "start": 303, "end": 396, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 95 } } } ] }, { "type": "ArrayExpression", "start": 417, "end": 430, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 15 } }, "elements": [ { "type": "NumericLiteral", "start": 418, "end": 419, "loc": { "start": { "line": 12, "column": 3 }, "end": { "line": 12, "column": 4 } }, "extra": { "rawValue": 2, "raw": "2" }, "value": 2 }, { "type": "StringLiteral", "start": 421, "end": 429, "loc": { "start": { "line": 12, "column": 6 }, "end": { "line": 12, "column": 14 } }, "extra": { "rawValue": "webgl2", "raw": "'webgl2'" }, "value": "webgl2" } ] } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 437, "end": 540, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 19, "column": 3 } }, "declarations": [ { "type": "VariableDeclarator", "start": 443, "end": 539, "loc": { "start": { "line": 14, "column": 6 }, "end": { "line": 19, "column": 2 } }, "id": { "type": "Identifier", "start": 443, "end": 451, "loc": { "start": { "line": 14, "column": 6 }, "end": { "line": 14, "column": 14 }, "identifierName": "vertices" }, "name": "vertices" }, "init": { "type": "NewExpression", "start": 454, "end": 539, "loc": { "start": { "line": 14, "column": 17 }, "end": { "line": 19, "column": 2 } }, "callee": { "type": "Identifier", "start": 458, "end": 470, "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 33 }, "identifierName": "Float32Array" }, "name": "Float32Array" }, "arguments": [ { "type": "ArrayExpression", "start": 471, "end": 538, "loc": { "start": { "line": 14, "column": 34 }, "end": { "line": 19, "column": 1 } }, "elements": [ { "type": "UnaryExpression", "start": 476, "end": 478, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 4 } }, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", "start": 477, "end": 478, "loc": { "start": { "line": 15, "column": 3 }, "end": { "line": 15, "column": 4 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, "extra": { "parenthesizedArgument": false } }, { "type": "UnaryExpression", "start": 480, "end": 482, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 8 } }, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", "start": 481, "end": 482, "loc": { "start": { "line": 15, "column": 7 }, "end": { "line": 15, "column": 8 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, "extra": { "parenthesizedArgument": false } }, { "type": "NumericLiteral", "start": 484, "end": 485, "loc": { "start": { "line": 15, "column": 10 }, "end": { "line": 15, "column": 11 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 487, "end": 488, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 14 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 493, "end": 494, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 3 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "UnaryExpression", "start": 496, "end": 498, "loc": { "start": { "line": 16, "column": 5 }, "end": { "line": 16, "column": 7 } }, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", "start": 497, "end": 498, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 7 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, "extra": { "parenthesizedArgument": false } }, { "type": "NumericLiteral", "start": 500, "end": 501, "loc": { "start": { "line": 16, "column": 9 }, "end": { "line": 16, "column": 10 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "NumericLiteral", "start": 503, "end": 504, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 13 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 509, "end": 510, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 3 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "NumericLiteral", "start": 512, "end": 513, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 6 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "NumericLiteral", "start": 515, "end": 516, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 9 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "NumericLiteral", "start": 518, "end": 519, "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 12 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "UnaryExpression", "start": 524, "end": 526, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 4 } }, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", "start": 525, "end": 526, "loc": { "start": { "line": 18, "column": 3 }, "end": { "line": 18, "column": 4 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, "extra": { "parenthesizedArgument": false } }, { "type": "NumericLiteral", "start": 528, "end": 529, "loc": { "start": { "line": 18, "column": 6 }, "end": { "line": 18, "column": 7 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "NumericLiteral", "start": 531, "end": 532, "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 10 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 534, "end": 535, "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 13 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 } ] } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 542, "end": 603, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 23, "column": 3 } }, "declarations": [ { "type": "VariableDeclarator", "start": 548, "end": 602, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 23, "column": 2 } }, "id": { "type": "Identifier", "start": 548, "end": 555, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 13 }, "identifierName": "indices" }, "name": "indices" }, "init": { "type": "NewExpression", "start": 558, "end": 602, "loc": { "start": { "line": 20, "column": 16 }, "end": { "line": 23, "column": 2 } }, "callee": { "type": "Identifier", "start": 562, "end": 573, "loc": { "start": { "line": 20, "column": 20 }, "end": { "line": 20, "column": 31 }, "identifierName": "Uint16Array" }, "name": "Uint16Array" }, "arguments": [ { "type": "ArrayExpression", "start": 574, "end": 601, "loc": { "start": { "line": 20, "column": 32 }, "end": { "line": 23, "column": 1 } }, "elements": [ { "type": "NumericLiteral", "start": 579, "end": 580, "loc": { "start": { "line": 21, "column": 2 }, "end": { "line": 21, "column": 3 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 582, "end": 583, "loc": { "start": { "line": 21, "column": 5 }, "end": { "line": 21, "column": 6 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, { "type": "NumericLiteral", "start": 585, "end": 586, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 9 } }, "extra": { "rawValue": 2, "raw": "2" }, "value": 2 }, { "type": "NumericLiteral", "start": 591, "end": 592, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 22, "column": 3 } }, "extra": { "rawValue": 2, "raw": "2" }, "value": 2 }, { "type": "NumericLiteral", "start": 594, "end": 595, "loc": { "start": { "line": 22, "column": 5 }, "end": { "line": 22, "column": 6 } }, "extra": { "rawValue": 3, "raw": "3" }, "value": 3 }, { "type": "NumericLiteral", "start": 597, "end": 598, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 22, "column": 9 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } ] } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 605, "end": 3643, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 139, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 611, "end": 3642, "loc": { "start": { "line": 24, "column": 6 }, "end": { "line": 139, "column": 1 } }, "id": { "type": "Identifier", "start": 611, "end": 621, "loc": { "start": { "line": 24, "column": 6 }, "end": { "line": 24, "column": 16 }, "identifierName": "extensions" }, "name": "extensions" }, "init": { "type": "ObjectExpression", "start": 624, "end": 3642, "loc": { "start": { "line": 24, "column": 19 }, "end": { "line": 139, "column": 1 } }, "properties": [ { "type": "ObjectProperty", "start": 629, "end": 712, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 28, "column": 3 } }, "method": false,