oxygen-core
Version:
Oxygen game engine (Xenon Core for browsers)
1,434 lines (1,433 loc) • 2.28 MB
JSON
{
"type": "File",
"start": 0,
"end": 12529,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 509,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 12529,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 509,
"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": 103,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 51
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 59,
"end": 65,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 59,
"end": 65,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
},
"identifierName": "parser"
},
"name": "parser"
}
}
],
"source": {
"type": "StringLiteral",
"start": 71,
"end": 102,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 50
}
},
"extra": {
"rawValue": "../utils/particleSystemParser",
"raw": "'../utils/particleSystemParser'"
},
"value": "../utils/particleSystemParser"
},
"trailingComments": [
{
"type": "CommentLine",
"value": " base vertex layout:",
"start": 107,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 22
}
}
},
{
"type": "CommentLine",
"value": " float: life;",
"start": 131,
"end": 146,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 15
}
}
},
{
"type": "CommentLine",
"value": " float: timeScale;",
"start": 148,
"end": 168,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 20
}
}
},
{
"type": "CommentLine",
"value": " vec2: vertex position;",
"start": 170,
"end": 195,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 25
}
}
},
{
"type": "CommentLine",
"value": " vec2: tex coord;",
"start": 197,
"end": 216,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 19
}
}
}
]
},
{
"type": "VariableDeclaration",
"start": 220,
"end": 249,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 10,
"column": 29
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 226,
"end": 248,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 28
}
},
"id": {
"type": "Identifier",
"start": 226,
"end": 236,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 16
},
"identifierName": "processors"
},
"name": "processors",
"leadingComments": null
},
"init": {
"type": "NewExpression",
"start": 239,
"end": 248,
"loc": {
"start": {
"line": 10,
"column": 19
},
"end": {
"line": 10,
"column": 28
}
},
"callee": {
"type": "Identifier",
"start": 243,
"end": 246,
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 26
},
"identifierName": "Map"
},
"name": "Map"
},
"arguments": []
},
"leadingComments": null
}
],
"kind": "const",
"leadingComments": [
{
"type": "CommentLine",
"value": " base vertex layout:",
"start": 107,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 22
}
}
},
{
"type": "CommentLine",
"value": " float: life;",
"start": 131,
"end": 146,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 15
}
}
},
{
"type": "CommentLine",
"value": " float: timeScale;",
"start": 148,
"end": 168,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 20
}
}
},
{
"type": "CommentLine",
"value": " vec2: vertex position;",
"start": 170,
"end": 195,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 25
}
}
},
{
"type": "CommentLine",
"value": " vec2: tex coord;",
"start": 197,
"end": 216,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 19
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * Particles renderer.\r\n *\r\n * @example\r\n * const component = new Particles();\r\n * component.deserialize({ shader: 'shaders/particles.json', processor: 'particles/fire.ps' });\r\n ",
"start": 253,
"end": 438,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 18,
"column": 3
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 440,
"end": 12527,
"loc": {
"start": {
"line": 19,
"column": 0
},
"end": {
"line": 508,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 455,
"end": 12527,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 508,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 461,
"end": 470,
"loc": {
"start": {
"line": 19,
"column": 21
},
"end": {
"line": 19,
"column": 30
},
"identifierName": "Particles"
},
"name": "Particles",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 479,
"end": 495,
"loc": {
"start": {
"line": 19,
"column": 39
},
"end": {
"line": 19,
"column": 55
},
"identifierName": "VerticesRenderer"
},
"name": "VerticesRenderer"
},
"body": {
"type": "ClassBody",
"start": 496,
"end": 12527,
"loc": {
"start": {
"line": 19,
"column": 56
},
"end": {
"line": 508,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 594,
"end": 646,
"loc": {
"start": {
"line": 26,
"column": 2
},
"end": {
"line": 28,
"column": 3
}
},
"static": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 601,
"end": 608,
"loc": {
"start": {
"line": 26,
"column": 9
},
"end": {
"line": 26,
"column": 16
},
"identifierName": "factory"
},
"name": "factory"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 611,
"end": 646,
"loc": {
"start": {
"line": 26,
"column": 19
},
"end": {
"line": 28,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 618,
"end": 641,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 27
}
},
"argument": {
"type": "NewExpression",
"start": 625,
"end": 640,
"loc": {
"start": {
"line": 27,
"column": 11
},
"end": {
"line": 27,
"column": 26
}
},
"callee": {
"type": "Identifier",
"start": 629,
"end": 638,
"loc": {
"start": {
"line": 27,
"column": 15
},
"end": {
"line": 27,
"column": 24
},
"identifierName": "Particles"
},
"name": "Particles"
},
"arguments": []
}
}
],
"directives": [],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * Component factory.\r\n *\r\n * @return {Particles} Component instance.\r\n ",
"start": 503,
"end": 590,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 25,
"column": 5
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "* @type {*} ",
"start": 652,
"end": 668,
"loc": {
"start": {
"line": 30,
"column": 2
},
"end": {
"line": 30,
"column": 18
}
}
}
]
},
{
"type": "ClassMethod",
"start": 672,
"end": 1222,
"loc": {
"start": {
"line": 31,
"column": 2
},
"end": {
"line": 45,
"column": 3
}
},
"static": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 683,
"end": 693,
"loc": {
"start": {
"line": 31,
"column": 13
},
"end": {
"line": 31,
"column": 23
},
"identifierName": "propsTypes"
},
"name": "propsTypes"
},
"kind": "get",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 696,
"end": 1222,
"loc": {
"start": {
"line": 31,
"column": 26
},
"end": {
"line": 45,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 703,
"end": 1217,
"loc": {
"start": {
"line": 32,
"column": 4
},
"end": {
"line": 44,
"column": 6
}
},
"argument": {
"type": "ObjectExpression",
"start": 710,
"end": 1216,
"loc": {
"start": {
"line": 32,
"column": 11
},
"end": {
"line": 44,
"column": 5
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 719,
"end": 763,
"loc": {
"start": {
"line": 33,
"column": 6
},
"end": {
"line": 33,
"column": 50
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 719,
"end": 726,
"loc": {
"start": {
"line": 33,
"column": 6
},
"end": {
"line": 33,
"column": 13
},
"identifierName": "visible"
},
"name": "visible"
},
"value": {
"type": "MemberExpression",
"start": 728,
"end": 763,
"loc": {
"start": {
"line": 33,
"column": 15
},
"end": {
"line": 33,
"column": 50
}
},
"object": {
"type": "MemberExpression",
"start": 728,
"end": 755,
"loc": {
"start": {
"line": 33,
"column": 15
},
"end": {
"line": 33,
"column": 42
}
},
"object": {
"type": "Identifier",
"start": 728,
"end": 744,
"loc": {
"start": {
"line": 33,
"column": 15
},
"end": {
"line": 33,
"column": 31
},
"identifierName": "VerticesRenderer"
},
"name": "VerticesRenderer"
},
"property": {
"type": "Identifier",
"start": 745,
"end": 755,
"loc": {
"start": {
"line": 33,
"column": 32
},
"end": {
"line": 33,
"column": 42
},
"identifierName": "propsTypes"
},
"name": "propsTypes"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 756,
"end": 763,
"loc": {
"start": {
"line": 33,
"column": 43
},
"end": {
"line": 33,
"column": 50
},
"identifierName": "visible"
},
"name": "visible"
},
"computed": false
}
},
{
"type": "ObjectProperty",
"start": 772,
"end": 814,
"loc": {
"start": {
"line": 34,
"column": 6
},
"end": {
"line": 34,
"column": 48
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 772,
"end": 778,
"loc": {
"start": {
"line": 34,
"column": 6
},
"end": {
"line": 34,
"column": 12
},
"identifierName": "shader"
},
"name": "shader"
},
"value": {
"type": "MemberExpression",
"start": 780,
"end": 814,
"loc": {
"start": {
"line": 34,
"column": 14
},
"end": {
"line": 34,
"column": 48
}
},
"object": {
"type": "MemberExpression",
"start": 780,
"end": 807,
"loc": {
"start": {
"line": 34,
"column": 14
},
"end": {
"line": 34,
"column": 41
}
},
"object": {
"type": "Identifier",
"start": 780,
"end": 796,
"loc": {
"start": {
"line": 34,
"column": 14
},
"end": {
"line": 34,
"column": 30
},
"identifierName": "VerticesRenderer"
},
"name": "VerticesRenderer"
},
"property": {
"type": "Identifier",
"start": 797,
"end": 807,
"loc": {
"start": {
"line": 34,
"column": 31
},
"end": {
"line": 34,
"column": 41
},
"identifierName": "propsTypes"
},
"name": "propsTypes"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 808,
"end": 814,
"loc": {
"start": {
"line": 34,
"column": 42
},
"end": {
"line": 34,
"column": 48
},
"identifierName": "shader"
},
"name": "shader"
},
"computed": false
}
},
{
"type": "ObjectProperty",
"start": 823,
"end": 885,
"loc": {
"start": {
"line": 35,
"column": 6
},
"end": {
"line": 35,
"column": 68
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 823,
"end": 839,
"loc": {
"start": {
"line": 35,
"column": 6
},
"end": {
"line": 35,
"column": 22
},
"identifierName": "overrideUniforms"
},
"name": "overrideUniforms"
},
"value": {
"type": "MemberExpression",
"start": 841,
"end": 885,
"loc": {
"start": {
"line": 35,
"column": 24
},
"end": {
"line": 35,
"column": 68
}
},
"object": {
"type": "MemberExpression",
"start": 841,
"end": 868,
"loc": {
"start": {
"line": 35,
"column": 24
},
"end": {
"line": 35,
"column": 51
}
},
"object": {
"type": "Identifier",
"start": 841,
"end": 857,
"loc": {
"start": {
"line": 35,
"column": 24
},
"end": {
"line": 35,
"column": 40
},
"identifierName": "VerticesRenderer"
},
"name": "VerticesRenderer"
},
"property": {
"type": "Identifier",
"start": 858,
"end": 868,
"loc": {
"start": {
"line": 35,
"column": 41
},
"end": {
"line": 35,
"column": 51
},
"identifierName": "propsTypes"
},
"name": "propsTypes"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 869,
"end": 885,
"loc": {
"start": {
"line": 35,
"column": 52
},
"end": {
"line": 35,
"column": 68
},
"identifierName": "overrideUniforms"
},
"name": "overrideUniforms"
},
"computed": false
}
},
{
"type": "ObjectProperty",
"start": 894,
"end": 956,
"loc": {
"start": {
"line": 36,
"column": 6
},
"end": {
"line": 36,
"column": 68
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 894,
"end": 910,
"loc": {
"start": {
"line": 36,
"column": 6
},
"end": {
"line": 36,
"column": 22
},
"identifierName": "overrideSamplers"
},
"name": "overrideSamplers"
},
"value": {
"type": "MemberExpression",
"start": 912,
"end": 956,
"loc": {
"start": {
"line": 36,
"column": 24
},
"end": {
"line": 36,
"column": 68
}
},
"object": {
"type": "MemberExpression",
"start": 912,
"end": 939,
"loc": {
"start": {
"line": 36,
"column": 24
},
"end": {
"line": 36,
"column": 51
}
},
"object": {
"type": "Identifier",
"start": 912,
"end": 928,
"loc": {
"start": {
"line": 36,
"column": 24
},
"end": {
"line": 36,
"column": 40
},
"identifierName": "VerticesRenderer"
},
"name": "VerticesRenderer"
},
"property": {
"type": "Identifier",
"start": 929,
"end": 939,
"loc": {
"start": {
"line": 36,
"column": 41
},
"end": {
"line": 36,
"column": 51
},
"identifierName": "propsTypes"
},
"name": "propsTypes"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 940,
"end": 956,
"loc": {
"start": {
"line": 36,
"column": 52
},
"end": {
"line": 36,
"column": 68
},
"identifierName": "overrideSamplers"
},
"name": "overrideSamplers"
},
"computed": false
}
},
{
"type": "ObjectProperty",
"start": 965,
"end": 1007,
"loc": {
"start": {
"line": 37,
"column": 6
},
"end": {
"line": 37,
"column": 48
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 965,
"end": 971,
"loc": {
"start": {
"line": 37,
"column": 6
},
"end": {
"line": 37,
"column": 12
},
"identifierName": "layers"
},
"name": "layers"
},
"value": {
"type": "MemberExpression",
"start": 973,
"end": 1007,
"loc": {
"start": {
"line": 37,
"column": 14
},
"end": {
"line": 37,
"column": 48
}
},
"object": {
"type": "MemberExpression",
"start": 973,
"end": 1000,
"loc": {
"start": {
"line": 37,
"column": 14
},
"end": {
"line": 37,
"column": 41
}
},
"object": {
"type": "Identifier",
"start": 973,
"end": 989,
"loc": {
"start": {
"line": 37,
"column": 14
},
"end": {
"line": 37,
"column": 30
},
"identifierName": "VerticesRenderer"
},
"name": "VerticesRenderer"
},
"property": {
"type": "Identifier",
"start": 990,
"end": 1000,
"loc": {
"start": {
"line": 37,
"column": 31
},
"end": {
"line": 37,
"column": 41
},
"identifierName": "propsTypes"
},
"name": "propsTypes"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 1001,
"end": 1007,
"loc": {
"start": {
"line": 37,
"column": 42
},
"end": {
"line": 37,
"column": 48
},
"identifierName": "layers"
},
"name": "layers"
},
"computed": false
}
},
{
"type": "ObjectProperty",
"start": 1016,
"end": 1035,
"loc": {
"start": {
"line": 38,
"column": 6
},
"end": {
"line": 38,
"column": 25
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 1016,
"end": 1024,
"loc": {
"start": {
"line": 38,
"column": 6
},
"end": {
"line": 38,
"column": 14
},
"identifierName": "capacity"
},
"name": "capacity"
},
"value": {
"type": "StringLiteral",
"start": 1026,
"end": 1035,
"loc": {
"start": {
"line": 38,
"column": 16
},
"end": {
"line": 38,
"column": 25
}
},
"extra": {
"rawValue": "integer",
"raw": "'integer'"
},
"value": "integer"
}
},
{
"type": "ObjectProperty",
"start": 1044,
"end": 1063,
"loc": {
"start": {
"line": 39,
"column": 6
},
"end": {
"line": 39,
"column": 25
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 1044,
"end": 1053,
"loc": {
"start": {
"line": 39,
"column": 6
},
"end": {
"line": 39,
"column": 15
},
"identifierName": "processor"
},
"name": "processor"
},
"value": {
"type": "StringLiteral",
"start": 1055,
"end": 1063,
"loc": {
"start": {
"line": 39,
"column": 17
},
"end": {
"line": 39,
"column": 25
}
},
"extra": {