UNPKG

oxygen-core

Version:

Oxygen game engine (Xenon Core for browsers)

1,564 lines (1,563 loc) 2.51 MB
{ "type": "File", "start": 0, "end": 12941, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 530, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 12941, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 530, "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": 102, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 42 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 69, "end": 73, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 13 } }, "imported": { "type": "Identifier", "start": 69, "end": 73, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 13 }, "identifierName": "mat4" }, "name": "mat4" }, "local": { "type": "Identifier", "start": 69, "end": 73, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 13 }, "identifierName": "mat4" }, "name": "mat4" } } ], "source": { "type": "StringLiteral", "start": 81, "end": 101, "loc": { "start": { "line": 2, "column": 21 }, "end": { "line": 2, "column": 41 } }, "extra": { "rawValue": "../utils/gl-matrix", "raw": "'../utils/gl-matrix'" }, "value": "../utils/gl-matrix" } }, { "type": "VariableDeclaration", "start": 106, "end": 196, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 8, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 112, "end": 195, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 8, "column": 1 } }, "id": { "type": "Identifier", "start": 112, "end": 122, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 16 }, "identifierName": "RenderMode" }, "name": "RenderMode" }, "init": { "type": "ObjectExpression", "start": 125, "end": 195, "loc": { "start": { "line": 4, "column": 19 }, "end": { "line": 8, "column": 1 } }, "properties": [ { "type": "ObjectProperty", "start": 130, "end": 152, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 24 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 130, "end": 139, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 11 }, "identifierName": "TRIANGLES" }, "name": "TRIANGLES" }, "value": { "type": "StringLiteral", "start": 141, "end": 152, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 24 } }, "extra": { "rawValue": "triangles", "raw": "'triangles'" }, "value": "triangles" } }, { "type": "ObjectProperty", "start": 157, "end": 171, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 16 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 157, "end": 162, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 7 }, "identifierName": "LINES" }, "name": "LINES" }, "value": { "type": "StringLiteral", "start": 164, "end": 171, "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 16 } }, "extra": { "rawValue": "lines", "raw": "'lines'" }, "value": "lines" } }, { "type": "ObjectProperty", "start": 176, "end": 192, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 18 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 176, "end": 182, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 8 }, "identifierName": "POINTS" }, "name": "POINTS" }, "value": { "type": "StringLiteral", "start": 184, "end": 192, "loc": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 18 } }, "extra": { "rawValue": "points", "raw": "'points'" }, "value": "points" } } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 200, "end": 288, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 14, "column": 1 } }, "declarations": [ { "type": "VariableDeclarator", "start": 206, "end": 288, "loc": { "start": { "line": 10, "column": 6 }, "end": { "line": 14, "column": 1 } }, "id": { "type": "Identifier", "start": 206, "end": 217, "loc": { "start": { "line": 10, "column": 6 }, "end": { "line": 10, "column": 17 }, "identifierName": "BufferUsage" }, "name": "BufferUsage" }, "init": { "type": "ObjectExpression", "start": 220, "end": 288, "loc": { "start": { "line": 10, "column": 20 }, "end": { "line": 14, "column": 1 } }, "properties": [ { "type": "ObjectProperty", "start": 225, "end": 241, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 18 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 225, "end": 231, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 8 }, "identifierName": "STATIC" }, "name": "STATIC" }, "value": { "type": "StringLiteral", "start": 233, "end": 241, "loc": { "start": { "line": 11, "column": 10 }, "end": { "line": 11, "column": 18 } }, "extra": { "rawValue": "static", "raw": "'static'" }, "value": "static" } }, { "type": "ObjectProperty", "start": 246, "end": 264, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 20 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 246, "end": 253, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 9 }, "identifierName": "DYNAMIC" }, "name": "DYNAMIC" }, "value": { "type": "StringLiteral", "start": 255, "end": 264, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 12, "column": 20 } }, "extra": { "rawValue": "dynamic", "raw": "'dynamic'" }, "value": "dynamic" } }, { "type": "ObjectProperty", "start": 269, "end": 285, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 18 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 269, "end": 275, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 8 }, "identifierName": "STREAM" }, "name": "STREAM" }, "value": { "type": "StringLiteral", "start": 277, "end": 285, "loc": { "start": { "line": 13, "column": 10 }, "end": { "line": 13, "column": 18 } }, "extra": { "rawValue": "stream", "raw": "'stream'" }, "value": "stream" } } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 292, "end": 348, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 20, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 298, "end": 347, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 20, "column": 1 } }, "id": { "type": "Identifier", "start": 298, "end": 307, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 15 }, "identifierName": "DirtyMode" }, "name": "DirtyMode" }, "init": { "type": "ObjectExpression", "start": 310, "end": 347, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 20, "column": 1 } }, "properties": [ { "type": "ObjectProperty", "start": 315, "end": 322, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 9 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 315, "end": 319, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 6 }, "identifierName": "NONE" }, "name": "NONE" }, "value": { "type": "NumericLiteral", "start": 321, "end": 322, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 9 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } }, { "type": "ObjectProperty", "start": 327, "end": 333, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 8 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 327, "end": 330, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 5 }, "identifierName": "SUB" }, "name": "SUB" }, "value": { "type": "NumericLiteral", "start": 332, "end": 333, "loc": { "start": { "line": 18, "column": 7 }, "end": { "line": 18, "column": 8 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 } }, { "type": "ObjectProperty", "start": 338, "end": 344, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 19, "column": 8 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 338, "end": 341, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 19, "column": 5 }, "identifierName": "ALL" }, "name": "ALL" }, "value": { "type": "NumericLiteral", "start": 343, "end": 344, "loc": { "start": { "line": 19, "column": 7 }, "end": { "line": 19, "column": 8 } }, "extra": { "rawValue": 2, "raw": "2" }, "value": 2 } } ] } } ], "kind": "const" }, { "type": "ExportDefaultDeclaration", "start": 352, "end": 12939, "loc": { "start": { "line": 22, "column": 0 }, "end": { "line": 529, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 367, "end": 12939, "loc": { "start": { "line": 22, "column": 15 }, "end": { "line": 529, "column": 1 } }, "id": { "type": "Identifier", "start": 373, "end": 389, "loc": { "start": { "line": 22, "column": 21 }, "end": { "line": 22, "column": 37 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "superClass": { "type": "Identifier", "start": 398, "end": 407, "loc": { "start": { "line": 22, "column": 46 }, "end": { "line": 22, "column": 55 }, "identifierName": "Component" }, "name": "Component" }, "body": { "type": "ClassBody", "start": 408, "end": 12939, "loc": { "start": { "line": 22, "column": 56 }, "end": { "line": 529, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 415, "end": 474, "loc": { "start": { "line": 24, "column": 2 }, "end": { "line": 26, "column": 3 } }, "static": true, "computed": false, "key": { "type": "Identifier", "start": 422, "end": 429, "loc": { "start": { "line": 24, "column": 9 }, "end": { "line": 24, "column": 16 }, "identifierName": "factory" }, "name": "factory" }, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 432, "end": 474, "loc": { "start": { "line": 24, "column": 19 }, "end": { "line": 26, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 439, "end": 469, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 34 } }, "argument": { "type": "NewExpression", "start": 446, "end": 468, "loc": { "start": { "line": 25, "column": 11 }, "end": { "line": 25, "column": 33 } }, "callee": { "type": "Identifier", "start": 450, "end": 466, "loc": { "start": { "line": 25, "column": 15 }, "end": { "line": 25, "column": 31 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "arguments": [] } } ], "directives": [] } }, { "type": "ClassMethod", "start": 480, "end": 926, "loc": { "start": { "line": 28, "column": 2 }, "end": { "line": 41, "column": 3 } }, "static": true, "computed": false, "key": { "type": "Identifier", "start": 491, "end": 501, "loc": { "start": { "line": 28, "column": 13 }, "end": { "line": 28, "column": 23 }, "identifierName": "propsTypes" }, "name": "propsTypes" }, "kind": "get", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 504, "end": 926, "loc": { "start": { "line": 28, "column": 26 }, "end": { "line": 41, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 511, "end": 921, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 40, "column": 6 } }, "argument": { "type": "ObjectExpression", "start": 518, "end": 920, "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 40, "column": 5 } }, "properties": [ { "type": "ObjectProperty", "start": 527, "end": 545, "loc": { "start": { "line": 30, "column": 6 }, "end": { "line": 30, "column": 24 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 527, "end": 534, "loc": { "start": { "line": 30, "column": 6 }, "end": { "line": 30, "column": 13 }, "identifierName": "visible" }, "name": "visible" }, "value": { "type": "StringLiteral", "start": 536, "end": 545, "loc": { "start": { "line": 30, "column": 15 }, "end": { "line": 30, "column": 24 } }, "extra": { "rawValue": "boolean", "raw": "'boolean'" }, "value": "boolean" } }, { "type": "ObjectProperty", "start": 554, "end": 577, "loc": { "start": { "line": 31, "column": 6 }, "end": { "line": 31, "column": 29 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 554, "end": 560, "loc": { "start": { "line": 31, "column": 6 }, "end": { "line": 31, "column": 12 }, "identifierName": "shader" }, "name": "shader" }, "value": { "type": "StringLiteral", "start": 562, "end": 577, "loc": { "start": { "line": 31, "column": 14 }, "end": { "line": 31, "column": 29 } }, "extra": { "rawValue": "asset(shader)", "raw": "'asset(shader)'" }, "value": "asset(shader)" } }, { "type": "ObjectProperty", "start": 586, "end": 611, "loc": { "start": { "line": 32, "column": 6 }, "end": { "line": 32, "column": 31 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 586, "end": 594, "loc": { "start": { "line": 32, "column": 6 }, "end": { "line": 32, "column": 14 }, "identifierName": "vertices" }, "name": "vertices" }, "value": { "type": "StringLiteral", "start": 596, "end": 611, "loc": { "start": { "line": 32, "column": 16 }, "end": { "line": 32, "column": 31 } }, "extra": { "rawValue": "array(number)", "raw": "'array(number)'" }, "value": "array(number)" } }, { "type": "ObjectProperty", "start": 620, "end": 645, "loc": { "start": { "line": 33, "column": 6 }, "end": { "line": 33, "column": 31 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 620, "end": 627, "loc": { "start": { "line": 33, "column": 6 }, "end": { "line": 33, "column": 13 }, "identifierName": "indices" }, "name": "indices" }, "value": { "type": "StringLiteral", "start": 629, "end": 645, "loc": { "start": { "line": 33, "column": 15 }, "end": { "line": 33, "column": 31 } }, "extra": { "rawValue": "array(integer)", "raw": "'array(integer)'" }, "value": "array(integer)" } }, { "type": "ObjectProperty", "start": 654, "end": 700, "loc": { "start": { "line": 34, "column": 6 }, "end": { "line": 34, "column": 52 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 654, "end": 667, "loc": { "start": { "line": 34, "column": 6 }, "end": { "line": 34, "column": 19 }, "identifierName": "verticesUsage" }, "name": "verticesUsage" }, "value": { "type": "StringLiteral", "start": 669, "end": 700, "loc": { "start": { "line": 34, "column": 21 }, "end": { "line": 34, "column": 52 } }, "extra": { "rawValue": "enum(static, dynamic, stream)", "raw": "'enum(static, dynamic, stream)'" }, "value": "enum(static, dynamic, stream)" } }, { "type": "ObjectProperty", "start": 709, "end": 754, "loc": { "start": { "line": 35, "column": 6 }, "end": { "line": 35, "column": 51 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 709, "end": 721, "loc": { "start": { "line": 35, "column": 6 }, "end": { "line": 35, "column": 18 }, "identifierName": "indicesUsage" }, "name": "indicesUsage" }, "value": { "type": "StringLiteral", "start": 723, "end": 754, "loc": { "start": { "line": 35, "column": 20 }, "end": { "line": 35, "column": 51 } }, "extra": { "rawValue": "enum(static, dynamic, stream)", "raw": "'enum(static, dynamic, stream)'" }, "value": "enum(static, dynamic, stream)" } }, { "type": "ObjectProperty", "start": 763, "end": 791, "loc": { "start": { "line": 36, "column": 6 }, "end": { "line": 36, "column": 34 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 763, "end": 779, "loc": { "start": { "line": 36, "column": 6 }, "end": { "line": 36, "column": 22 }, "identifierName": "overrideUniforms" }, "name": "overrideUniforms" }, "value": { "type": "StringLiteral", "start": 781, "end": 791, "loc": { "start": { "line": 36, "column": 24 }, "end": { "line": 36, "column": 34 } }, "extra": { "rawValue": "uniforms", "raw": "'uniforms'" }, "value": "uniforms" } }, { "type": "ObjectProperty", "start": 800, "end": 828, "loc": { "start": { "line": 37, "column": 6 }, "end": { "line": 37, "column": 34 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 800, "end": 816, "loc": { "start": { "line": 37, "column": 6 }, "end": { "line": 37, "column": 22 }, "identifierName": "overrideSamplers"