UNPKG

oxygen-core

Version:

Oxygen game engine (Xenon Core for browsers)

1,364 lines (1,363 loc) 841 kB
{ "type": "File", "start": 0, "end": 4329, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 188, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 4329, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 188, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 50, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 50 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 23, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 23 } }, "local": { "type": "Identifier", "start": 7, "end": 23, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 23 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" } } ], "source": { "type": "StringLiteral", "start": 29, "end": 49, "loc": { "start": { "line": 1, "column": 29 }, "end": { "line": 1, "column": 49 } }, "extra": { "rawValue": "./VerticesRenderer", "raw": "'./VerticesRenderer'" }, "value": "./VerticesRenderer" } }, { "type": "ImportDeclaration", "start": 52, "end": 94, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 42 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 61, "end": 65, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 13 } }, "imported": { "type": "Identifier", "start": 61, "end": 65, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 13 }, "identifierName": "vec4" }, "name": "vec4" }, "local": { "type": "Identifier", "start": 61, "end": 65, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 13 }, "identifierName": "vec4" }, "name": "vec4" } } ], "source": { "type": "StringLiteral", "start": 73, "end": 93, "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": "ImportDeclaration", "start": 96, "end": 136, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 40 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 105, "end": 117, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 21 } }, "imported": { "type": "Identifier", "start": 105, "end": 117, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 21 }, "identifierName": "stringToRGBA" }, "name": "stringToRGBA" }, "local": { "type": "Identifier", "start": 105, "end": 117, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 21 }, "identifierName": "stringToRGBA" }, "name": "stringToRGBA" } } ], "source": { "type": "StringLiteral", "start": 125, "end": 135, "loc": { "start": { "line": 3, "column": 29 }, "end": { "line": 3, "column": 39 } }, "extra": { "rawValue": "../utils", "raw": "'../utils'" }, "value": "../utils" } }, { "type": "ExportDefaultDeclaration", "start": 140, "end": 4327, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 187, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 155, "end": 4327, "loc": { "start": { "line": 5, "column": 15 }, "end": { "line": 187, "column": 1 } }, "id": { "type": "Identifier", "start": 161, "end": 178, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 38 }, "identifierName": "RectangleRenderer" }, "name": "RectangleRenderer" }, "superClass": { "type": "Identifier", "start": 187, "end": 203, "loc": { "start": { "line": 5, "column": 47 }, "end": { "line": 5, "column": 63 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "body": { "type": "ClassBody", "start": 204, "end": 4327, "loc": { "start": { "line": 5, "column": 64 }, "end": { "line": 187, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 211, "end": 271, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 9, "column": 3 } }, "static": true, "computed": false, "key": { "type": "Identifier", "start": 218, "end": 225, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 16 }, "identifierName": "factory" }, "name": "factory" }, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 228, "end": 271, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 9, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 235, "end": 266, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 35 } }, "argument": { "type": "NewExpression", "start": 242, "end": 265, "loc": { "start": { "line": 8, "column": 11 }, "end": { "line": 8, "column": 34 } }, "callee": { "type": "Identifier", "start": 246, "end": 263, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 32 }, "identifierName": "RectangleRenderer" }, "name": "RectangleRenderer" }, "arguments": [] } } ], "directives": [] } }, { "type": "ClassMethod", "start": 277, "end": 800, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 26, "column": 3 } }, "static": true, "computed": false, "key": { "type": "Identifier", "start": 288, "end": 298, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 23 }, "identifierName": "propsTypes" }, "name": "propsTypes" }, "kind": "get", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 301, "end": 800, "loc": { "start": { "line": 11, "column": 26 }, "end": { "line": 26, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 308, "end": 795, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 25, "column": 6 } }, "argument": { "type": "ObjectExpression", "start": 315, "end": 794, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 25, "column": 5 } }, "properties": [ { "type": "ObjectProperty", "start": 324, "end": 368, "loc": { "start": { "line": 13, "column": 6 }, "end": { "line": 13, "column": 50 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 324, "end": 331, "loc": { "start": { "line": 13, "column": 6 }, "end": { "line": 13, "column": 13 }, "identifierName": "visible" }, "name": "visible" }, "value": { "type": "MemberExpression", "start": 333, "end": 368, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 50 } }, "object": { "type": "MemberExpression", "start": 333, "end": 360, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 42 } }, "object": { "type": "Identifier", "start": 333, "end": 349, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 31 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "property": { "type": "Identifier", "start": 350, "end": 360, "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 42 }, "identifierName": "propsTypes" }, "name": "propsTypes" }, "computed": false }, "property": { "type": "Identifier", "start": 361, "end": 368, "loc": { "start": { "line": 13, "column": 43 }, "end": { "line": 13, "column": 50 }, "identifierName": "visible" }, "name": "visible" }, "computed": false } }, { "type": "ObjectProperty", "start": 377, "end": 419, "loc": { "start": { "line": 14, "column": 6 }, "end": { "line": 14, "column": 48 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 377, "end": 383, "loc": { "start": { "line": 14, "column": 6 }, "end": { "line": 14, "column": 12 }, "identifierName": "shader" }, "name": "shader" }, "value": { "type": "MemberExpression", "start": 385, "end": 419, "loc": { "start": { "line": 14, "column": 14 }, "end": { "line": 14, "column": 48 } }, "object": { "type": "MemberExpression", "start": 385, "end": 412, "loc": { "start": { "line": 14, "column": 14 }, "end": { "line": 14, "column": 41 } }, "object": { "type": "Identifier", "start": 385, "end": 401, "loc": { "start": { "line": 14, "column": 14 }, "end": { "line": 14, "column": 30 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "property": { "type": "Identifier", "start": 402, "end": 412, "loc": { "start": { "line": 14, "column": 31 }, "end": { "line": 14, "column": 41 }, "identifierName": "propsTypes" }, "name": "propsTypes" }, "computed": false }, "property": { "type": "Identifier", "start": 413, "end": 419, "loc": { "start": { "line": 14, "column": 42 }, "end": { "line": 14, "column": 48 }, "identifierName": "shader" }, "name": "shader" }, "computed": false } }, { "type": "ObjectProperty", "start": 428, "end": 490, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 68 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 428, "end": 444, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 22 }, "identifierName": "overrideUniforms" }, "name": "overrideUniforms" }, "value": { "type": "MemberExpression", "start": 446, "end": 490, "loc": { "start": { "line": 15, "column": 24 }, "end": { "line": 15, "column": 68 } }, "object": { "type": "MemberExpression", "start": 446, "end": 473, "loc": { "start": { "line": 15, "column": 24 }, "end": { "line": 15, "column": 51 } }, "object": { "type": "Identifier", "start": 446, "end": 462, "loc": { "start": { "line": 15, "column": 24 }, "end": { "line": 15, "column": 40 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "property": { "type": "Identifier", "start": 463, "end": 473, "loc": { "start": { "line": 15, "column": 41 }, "end": { "line": 15, "column": 51 }, "identifierName": "propsTypes" }, "name": "propsTypes" }, "computed": false }, "property": { "type": "Identifier", "start": 474, "end": 490, "loc": { "start": { "line": 15, "column": 52 }, "end": { "line": 15, "column": 68 }, "identifierName": "overrideUniforms" }, "name": "overrideUniforms" }, "computed": false } }, { "type": "ObjectProperty", "start": 499, "end": 561, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 68 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 499, "end": 515, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 22 }, "identifierName": "overrideSamplers" }, "name": "overrideSamplers" }, "value": { "type": "MemberExpression", "start": 517, "end": 561, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 68 } }, "object": { "type": "MemberExpression", "start": 517, "end": 544, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 51 } }, "object": { "type": "Identifier", "start": 517, "end": 533, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 40 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "property": { "type": "Identifier", "start": 534, "end": 544, "loc": { "start": { "line": 16, "column": 41 }, "end": { "line": 16, "column": 51 }, "identifierName": "propsTypes" }, "name": "propsTypes" }, "computed": false }, "property": { "type": "Identifier", "start": 545, "end": 561, "loc": { "start": { "line": 16, "column": 52 }, "end": { "line": 16, "column": 68 }, "identifierName": "overrideSamplers" }, "name": "overrideSamplers" }, "computed": false } }, { "type": "ObjectProperty", "start": 570, "end": 612, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 48 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 570, "end": 576, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 12 }, "identifierName": "layers" }, "name": "layers" }, "value": { "type": "MemberExpression", "start": 578, "end": 612, "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 48 } }, "object": { "type": "MemberExpression", "start": 578, "end": 605, "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 41 } }, "object": { "type": "Identifier", "start": 578, "end": 594, "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 30 }, "identifierName": "VerticesRenderer" }, "name": "VerticesRenderer" }, "property": { "type": "Identifier", "start": 595, "end": 605, "loc": { "start": { "line": 17, "column": 31 }, "end": { "line": 17, "column": 41 }, "identifierName": "propsTypes" }, "name": "propsTypes" }, "computed": false }, "property": { "type": "Identifier", "start": 606, "end": 612, "loc": { "start": { "line": 17, "column": 42 }, "end": { "line": 17, "column": 48 }, "identifierName": "layers" }, "name": "layers" }, "computed": false } }, { "type": "ObjectProperty", "start": 621, "end": 636, "loc": { "start": { "line": 18, "column": 6 }, "end": { "line": 18, "column": 21 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 621, "end": 626, "loc": { "start": { "line": 18, "column": 6 }, "end": { "line": 18, "column": 11 }, "identifierName": "width" }, "name": "width" }, "value": { "type": "StringLiteral", "start": 628, "end": 636, "loc": { "start": { "line": 18, "column": 13 }, "end": { "line": 18, "column": 21 } }, "extra": { "rawValue": "number", "raw": "'number'" }, "value": "number" } }, { "type": "ObjectProperty", "start": 645, "end": 661, "loc": { "start": { "line": 19, "column": 6 }, "end": { "line": 19, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 645, "end": 651, "loc": { "start": { "line": 19, "column": 6 }, "end": { "line": 19, "column": 12 }, "identifierName": "height" }, "name": "height" }, "value": { "type": "StringLiteral", "start": 653, "end": 661, "loc": { "start": { "line": 19, "column": 14 }, "end": { "line": 19, "column": 22 } }, "extra": { "rawValue": "number", "raw": "'number'" }, "value": "number" } }, { "type": "ObjectProperty", "start": 670, "end": 687, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 23 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 670, "end": 677, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 13 }, "identifierName": "xOffset" }, "name": "xOffset" }, "value": { "type": "StringLiteral", "start": 679, "end": 687, "loc": { "start": { "line": 20, "column": 15 }, "end": { "line": 20, "column": 23 } }, "extra": { "rawValue": "number", "raw": "'number'" }, "value": "number" } }, { "type": "ObjectProperty", "start": 696, "end": 713, "loc": { "start": { "line": 21, "column": 6 }, "end": { "line": 21, "column": 23 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 696, "end": 703, "loc": { "start": { "line": 21, "column": 6 }, "end": { "line": 21, "column": 13 }, "identifierName": "yOffset" }, "name": "yOffset" }, "value": { "type": "StringLiteral", "start": 705, "end": 713, "loc": { "start": { "line": 21, "column": 15 }, "end": { "line": 21, "column": 23 } }, "extra": { "rawValue": "number", "raw": "'number'" }, "value": "number" } }, { "type": "ObjectProperty", "start": 722, "end": 739, "loc": { "start": { "line": 22, "column": 6 }, "end": { "line": 22, "column": 23 } }, "method": false, "shorthand": false,