UNPKG

oxygen-core

Version:

Oxygen game engine (Xenon Core for browsers)

1,766 lines (1,765 loc) 3.24 MB
{ "type": "File", "start": 0, "end": 19385, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 760, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 19385, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 760, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 58, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 58 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 16, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 16 } }, "local": { "type": "Identifier", "start": 7, "end": 16, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 16 }, "identifierName": "Component" }, "name": "Component" } } ], "source": { "type": "StringLiteral", "start": 22, "end": 57, "loc": { "start": { "line": 1, "column": 22 }, "end": { "line": 1, "column": 57 } }, "extra": { "rawValue": "../systems/EntitySystem/Component", "raw": "'../systems/EntitySystem/Component'" }, "value": "../systems/EntitySystem/Component" } }, { "type": "ImportDeclaration", "start": 60, "end": 149, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 89 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 67, "end": 79, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 } }, "local": { "type": "Identifier", "start": 67, "end": 79, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 }, "identifierName": "RenderSystem" }, "name": "RenderSystem" } }, { "type": "ImportSpecifier", "start": 83, "end": 90, "loc": { "start": { "line": 2, "column": 23 }, "end": { "line": 2, "column": 30 } }, "imported": { "type": "Identifier", "start": 83, "end": 90, "loc": { "start": { "line": 2, "column": 23 }, "end": { "line": 2, "column": 30 }, "identifierName": "Command" }, "name": "Command" }, "local": { "type": "Identifier", "start": 83, "end": 90, "loc": { "start": { "line": 2, "column": 23 }, "end": { "line": 2, "column": 30 }, "identifierName": "Command" }, "name": "Command" } }, { "type": "ImportSpecifier", "start": 92, "end": 115, "loc": { "start": { "line": 2, "column": 32 }, "end": { "line": 2, "column": 55 } }, "imported": { "type": "Identifier", "start": 92, "end": 115, "loc": { "start": { "line": 2, "column": 32 }, "end": { "line": 2, "column": 55 }, "identifierName": "RenderFullscreenCommand" }, "name": "RenderFullscreenCommand" }, "local": { "type": "Identifier", "start": 92, "end": 115, "loc": { "start": { "line": 2, "column": 32 }, "end": { "line": 2, "column": 55 }, "identifierName": "RenderFullscreenCommand" }, "name": "RenderFullscreenCommand" } } ], "source": { "type": "StringLiteral", "start": 123, "end": 148, "loc": { "start": { "line": 2, "column": 63 }, "end": { "line": 2, "column": 88 } }, "extra": { "rawValue": "../systems/RenderSystem", "raw": "'../systems/RenderSystem'" }, "value": "../systems/RenderSystem" } }, { "type": "ImportDeclaration", "start": 151, "end": 190, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 158, "end": 164, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "local": { "type": "Identifier", "start": 158, "end": 164, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 }, "identifierName": "System" }, "name": "System" } } ], "source": { "type": "StringLiteral", "start": 170, "end": 189, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 38 } }, "extra": { "rawValue": "../systems/System", "raw": "'../systems/System'" }, "value": "../systems/System" } }, { "type": "ImportDeclaration", "start": 192, "end": 240, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 48 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 201, "end": 205, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 13 } }, "imported": { "type": "Identifier", "start": 201, "end": 205, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 13 }, "identifierName": "mat4" }, "name": "mat4" }, "local": { "type": "Identifier", "start": 201, "end": 205, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 13 }, "identifierName": "mat4" }, "name": "mat4" } }, { "type": "ImportSpecifier", "start": 207, "end": 211, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 4, "column": 19 } }, "imported": { "type": "Identifier", "start": 207, "end": 211, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 4, "column": 19 }, "identifierName": "vec2" }, "name": "vec2" }, "local": { "type": "Identifier", "start": 207, "end": 211, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 4, "column": 19 }, "identifierName": "vec2" }, "name": "vec2" } } ], "source": { "type": "StringLiteral", "start": 219, "end": 239, "loc": { "start": { "line": 4, "column": 27 }, "end": { "line": 4, "column": 47 } }, "extra": { "rawValue": "../utils/gl-matrix", "raw": "'../utils/gl-matrix'" }, "value": "../utils/gl-matrix" } }, { "type": "ImportDeclaration", "start": 242, "end": 292, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 50 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 251, "end": 257, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 15 } }, "imported": { "type": "Identifier", "start": 251, "end": 257, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 15 }, "identifierName": "getPOT" }, "name": "getPOT" }, "local": { "type": "Identifier", "start": 251, "end": 257, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 15 }, "identifierName": "getPOT" }, "name": "getPOT" } }, { "type": "ImportSpecifier", "start": 259, "end": 273, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 31 } }, "imported": { "type": "Identifier", "start": 259, "end": 273, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 31 }, "identifierName": "getMipmapScale" }, "name": "getMipmapScale" }, "local": { "type": "Identifier", "start": 259, "end": 273, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 31 }, "identifierName": "getMipmapScale" }, "name": "getMipmapScale" } } ], "source": { "type": "StringLiteral", "start": 281, "end": 291, "loc": { "start": { "line": 5, "column": 39 }, "end": { "line": 5, "column": 49 } }, "extra": { "rawValue": "../utils", "raw": "'../utils'" }, "value": "../utils" } }, { "type": "VariableDeclaration", "start": 296, "end": 333, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 37 } }, "declarations": [ { "type": "VariableDeclarator", "start": 302, "end": 332, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 7, "column": 36 } }, "id": { "type": "Identifier", "start": 302, "end": 316, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 7, "column": 20 }, "identifierName": "cachedTempMat4" }, "name": "cachedTempMat4" }, "init": { "type": "CallExpression", "start": 319, "end": 332, "loc": { "start": { "line": 7, "column": 23 }, "end": { "line": 7, "column": 36 } }, "callee": { "type": "MemberExpression", "start": 319, "end": 330, "loc": { "start": { "line": 7, "column": 23 }, "end": { "line": 7, "column": 34 } }, "object": { "type": "Identifier", "start": 319, "end": 323, "loc": { "start": { "line": 7, "column": 23 }, "end": { "line": 7, "column": 27 }, "identifierName": "mat4" }, "name": "mat4" }, "property": { "type": "Identifier", "start": 324, "end": 330, "loc": { "start": { "line": 7, "column": 28 }, "end": { "line": 7, "column": 34 }, "identifierName": "create" }, "name": "create" }, "computed": false }, "arguments": [] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 335, "end": 428, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 10, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 341, "end": 427, "loc": { "start": { "line": 8, "column": 6 }, "end": { "line": 10, "column": 1 } }, "id": { "type": "Identifier", "start": 341, "end": 355, "loc": { "start": { "line": 8, "column": 6 }, "end": { "line": 8, "column": 20 }, "identifierName": "cachedZeroMat4" }, "name": "cachedZeroMat4" }, "init": { "type": "CallExpression", "start": 358, "end": 427, "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 10, "column": 1 } }, "callee": { "type": "MemberExpression", "start": 358, "end": 373, "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 8, "column": 38 } }, "object": { "type": "Identifier", "start": 358, "end": 362, "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 8, "column": 27 }, "identifierName": "mat4" }, "name": "mat4" }, "property": { "type": "Identifier", "start": 363, "end": 373, "loc": { "start": { "line": 8, "column": 28 }, "end": { "line": 8, "column": 38 }, "identifierName": "fromValues" }, "name": "fromValues" }, "computed": false }, "arguments": [ { "type": "NumericLiteral", "start": 378, "end": 379, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 3 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 381, "end": 382, "loc": { "start": { "line": 9, "column": 5 }, "end": { "line": 9, "column": 6 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 384, "end": 385, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 9 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 387, "end": 388, "loc": { "start": { "line": 9, "column": 11 }, "end": { "line": 9, "column": 12 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 390, "end": 391, "loc": { "start": { "line": 9, "column": 14 }, "end": { "line": 9, "column": 15 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 393, "end": 394, "loc": { "start": { "line": 9, "column": 17 }, "end": { "line": 9, "column": 18 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 396, "end": 397, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 21 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 399, "end": 400, "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 24 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 402, "end": 403, "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 27 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 405, "end": 406, "loc": { "start": { "line": 9, "column": 29 }, "end": { "line": 9, "column": 30 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 408, "end": 409, "loc": { "start": { "line": 9, "column": 32 }, "end": { "line": 9, "column": 33 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 411, "end": 412, "loc": { "start": { "line": 9, "column": 35 }, "end": { "line": 9, "column": 36 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 414, "end": 415, "loc": { "start": { "line": 9, "column": 38 }, "end": { "line": 9, "column": 39 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 417, "end": 418, "loc": { "start": { "line": 9, "column": 41 }, "end": { "line": 9, "column": 42 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 420, "end": 421, "loc": { "start": { "line": 9, "column": 44 }, "end": { "line": 9, "column": 45 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 423, "end": 424, "loc": { "start": { "line": 9, "column": 47 }, "end": { "line": 9, "column": 48 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 430, "end": 454, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 24 } }, "declarations": [ { "type": "VariableDeclarator", "start": 434, "end": 453, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 23 } }, "id": { "type": "Identifier", "start": 434, "end": 449, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 19 }, "identifierName": "rttUidGenerator" }, "name": "rttUidGenerator" }, "init": { "type": "NumericLiteral", "start": 452, "end": 453, "loc": { "start": { "line": 11, "column": 22 }, "end": { "line": 11, "column": 23 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } } ], "kind": "let" }, { "type": "ExportNamedDeclaration", "start": 458, "end": 4418, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 168, "column": 1 } }, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", "start": 465, "end": 4418, "loc": { "start": { "line": 13, "column": 7 }, "end": { "line": 168, "column": 1 } }, "id": { "type": "Identifier", "start": 471, "end": 486, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 28 }, "identifierName": "PostprocessPass" }, "name": "PostprocessPass" }, "superClass": null, "body": { "type": "ClassBody", "start": 487, "end": 4418, "loc": { "start": { "line": 13, "column": 29 }, "end": { "line": 168, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 494, "end": 626, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 19, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 494, "end": 505, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 13 }, "identifierName": "constructor" }, "name": "constructor" }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 508, "end": 626, "loc": { "start": { "line": 15, "column": 16 }, "end": { "line": 19, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 515, "end": 561, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 50 } }, "expression": { "type": "AssignmentExpression", "start": 515, "end": 560, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 49 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 515, "end": 528, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 17 } }, "object": { "type": "ThisExpression", "start": 515, "end": 519, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 8 } } }, "property": { "type": "Identifier", "start": 520, "end": 528, "loc": { "start": { "line": 16, "column": 9 }, "end": { "line": 16, "column": 17 }, "identifierName": "_command" }, "name": "_command" }, "computed": false }, "right": { "type": "NewExpression", "start": 531, "end": 560, "loc": { "start": { "line": 16, "column": 20 }, "end": { "line": 16, "column": 49 } }, "callee": { "type": "Identifier", "start": 535, "end": 558, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 47 }, "identifierName": "RenderFullscreenCommand" }, "name": "RenderFullscreenCommand" }, "arguments": [] } } }, { "type": "ExpressionStatement", "start": 567, "end": 593, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 30 } }, "expression": { "type": "AssignmentExpression", "start": 567, "end": 592, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 29 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 567, "end": 580, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 17 } }, "object": { "type": "ThisExpression", "start": 567, "end": 571, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 8 } } }, "property": { "type": "Identifier", "start": 572, "end": 580, "loc": { "start": { "line": 17, "column": 9 }, "end": { "line": 17, "column": 17 }, "identifierName": "_targets" }, "name": "_targets" }, "computed": false }, "right": { "type": "NewExpression", "start": 583, "end": 592, "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 29 } }, "callee": { "type": "Identifier", "start": 587, "end": 590, "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 27 }, "identifierName": "Map" }, "name": "Map" }, "arguments": [] } } }, { "type": "ExpressionStatement", "start": 599, "end": 621, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 26 } }, "expression": { "type": "AssignmentExpression", "start": 599, "end": 620, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 25 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 599, "end": 613, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 18 } }, "object": { "type": "ThisExpression", "start": 599, "end": 603, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 8 } } }, "property": { "type": "Identifier", "start": 604, "end": 613, "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 18 }, "identifierName": "_renderer" }, "name": "_renderer" }, "computed": false }, "right": { "type": "NullLiteral", "start": 616, "end": 620, "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 25 } } } } } ], "directives": [] } }, { "type": "ClassMethod", "start": 632, "end": 795, "loc": { "start": { "line": 21, "column": 2 }, "end": { "line": 29, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 632, "end": 639, "loc": { "start": { "line": 21, "column": 2 }, "end": { "line": 21, "column": 9 }, "identifierName": "dispose" }, "name": "dispose" }, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 642, "end": 795, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 29, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 649, "end": 673, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 28 } }, "expression": { "type": "CallExpression", "start": 649, "end": 672, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 27 } }, "callee": { "type": "MemberExpression", "start": 649, "end": 670, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 25 } }, "object": { "type": "MemberExpression",