oxygen-core
Version:
Oxygen game engine (Xenon Core for browsers)
1,537 lines (1,536 loc) • 438 kB
JSON
{
"type": "File",
"start": 0,
"end": 2429,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 113,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 2429,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 113,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 42,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 42
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 20
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 20
},
"identifierName": "bezierSampler"
},
"name": "bezierSampler"
}
}
],
"source": {
"type": "StringLiteral",
"start": 26,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 26
},
"end": {
"line": 1,
"column": 41
}
},
"extra": {
"rawValue": "bezier-easing",
"raw": "'bezier-easing'"
},
"value": "bezier-easing"
}
},
{
"type": "ImportDeclaration",
"start": 44,
"end": 93,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 49
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 51,
"end": 56,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 51,
"end": 56,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
},
"identifierName": "Asset"
},
"name": "Asset"
}
}
],
"source": {
"type": "StringLiteral",
"start": 62,
"end": 92,
"loc": {
"start": {
"line": 2,
"column": 18
},
"end": {
"line": 2,
"column": 48
}
},
"extra": {
"rawValue": "../systems/AssetSystem/Asset",
"raw": "'../systems/AssetSystem/Asset'"
},
"value": "../systems/AssetSystem/Asset"
}
},
{
"type": "FunctionDeclaration",
"start": 97,
"end": 144,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 6,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 106,
"end": 119,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 22
},
"identifierName": "linearSampler"
},
"name": "linearSampler"
},
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 122,
"end": 144,
"loc": {
"start": {
"line": 4,
"column": 25
},
"end": {
"line": 6,
"column": 1
}
},
"body": [
{
"type": "ReturnStatement",
"start": 127,
"end": 141,
"loc": {
"start": {
"line": 5,
"column": 2
},
"end": {
"line": 5,
"column": 16
}
},
"argument": {
"type": "ArrowFunctionExpression",
"start": 134,
"end": 140,
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 15
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 134,
"end": 135,
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 10
},
"identifierName": "x"
},
"name": "x"
}
],
"body": {
"type": "Identifier",
"start": 139,
"end": 140,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 15
},
"identifierName": "x"
},
"name": "x"
}
}
}
],
"directives": []
}
},
{
"type": "FunctionDeclaration",
"start": 148,
"end": 209,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 10,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 157,
"end": 171,
"loc": {
"start": {
"line": 8,
"column": 9
},
"end": {
"line": 8,
"column": 23
},
"identifierName": "steppedSampler"
},
"name": "steppedSampler"
},
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 174,
"end": 209,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 10,
"column": 1
}
},
"body": [
{
"type": "ReturnStatement",
"start": 179,
"end": 206,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 29
}
},
"argument": {
"type": "ArrowFunctionExpression",
"start": 186,
"end": 205,
"loc": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 9,
"column": 28
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 186,
"end": 187,
"loc": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 9,
"column": 10
},
"identifierName": "x"
},
"name": "x"
}
],
"body": {
"type": "ConditionalExpression",
"start": 191,
"end": 205,
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 28
}
},
"test": {
"type": "BinaryExpression",
"start": 191,
"end": 197,
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 20
}
},
"left": {
"type": "Identifier",
"start": 191,
"end": 192,
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 15
},
"identifierName": "x"
},
"name": "x"
},
"operator": ">=",
"right": {
"type": "NumericLiteral",
"start": 196,
"end": 197,
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 20
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
"consequent": {
"type": "NumericLiteral",
"start": 200,
"end": 201,
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 9,
"column": 24
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"alternate": {
"type": "NumericLiteral",
"start": 204,
"end": 205,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 28
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
}
}
}
}
],
"directives": []
}
},
{
"type": "FunctionDeclaration",
"start": 213,
"end": 1341,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 51,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 222,
"end": 235,
"loc": {
"start": {
"line": 12,
"column": 9
},
"end": {
"line": 12,
"column": 22
},
"identifierName": "applySamplers"
},
"name": "applySamplers"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 236,
"end": 240,
"loc": {
"start": {
"line": 12,
"column": 23
},
"end": {
"line": 12,
"column": 27
},
"identifierName": "data"
},
"name": "data"
}
],
"body": {
"type": "BlockStatement",
"start": 242,
"end": 1341,
"loc": {
"start": {
"line": 12,
"column": 29
},
"end": {
"line": 51,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 247,
"end": 277,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 15,
"column": 3
}
},
"test": {
"type": "UnaryExpression",
"start": 251,
"end": 256,
"loc": {
"start": {
"line": 13,
"column": 6
},
"end": {
"line": 13,
"column": 11
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 252,
"end": 256,
"loc": {
"start": {
"line": 13,
"column": 7
},
"end": {
"line": 13,
"column": 11
},
"identifierName": "data"
},
"name": "data"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 258,
"end": 277,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 15,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 265,
"end": 272,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 11
}
},
"argument": null
}
],
"directives": []
},
"alternate": null
},
{
"type": "VariableDeclaration",
"start": 283,
"end": 311,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 30
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 289,
"end": 310,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 29
}
},
"id": {
"type": "ObjectPattern",
"start": 289,
"end": 303,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 22
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 291,
"end": 301,
"loc": {
"start": {
"line": 17,
"column": 10
},
"end": {
"line": 17,
"column": 20
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 291,
"end": 301,
"loc": {
"start": {
"line": 17,
"column": 10
},
"end": {
"line": 17,
"column": 20
},
"identifierName": "animations"
},
"name": "animations"
},
"value": {
"type": "Identifier",
"start": 291,
"end": 301,
"loc": {
"start": {
"line": 17,
"column": 10
},
"end": {
"line": 17,
"column": 20
},
"identifierName": "animations"
},
"name": "animations"
},
"extra": {
"shorthand": true
}
}
]
},
"init": {
"type": "Identifier",
"start": 306,
"end": 310,
"loc": {
"start": {
"line": 17,
"column": 25
},
"end": {
"line": 17,
"column": 29
},
"identifierName": "data"
},
"name": "data"
}
}
],
"kind": "const"
},
{
"type": "IfStatement",
"start": 315,
"end": 351,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 20,
"column": 3
}
},
"test": {
"type": "UnaryExpression",
"start": 319,
"end": 330,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 18,
"column": 17
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 320,
"end": 330,
"loc": {
"start": {
"line": 18,
"column": 7
},
"end": {
"line": 18,
"column": 17
},
"identifierName": "animations"
},
"name": "animations"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 332,
"end": 351,
"loc": {
"start": {
"line": 18,
"column": 19
},
"end": {
"line": 20,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 339,
"end": 346,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 11
}
},
"argument": null
}
],
"directives": []
},
"alternate": null
},
{
"type": "ForInStatement",
"start": 357,
"end": 1338,
"loc": {
"start": {
"line": 22,
"column": 2
},
"end": {
"line": 50,
"column": 3
}
},
"left": {
"type": "VariableDeclaration",
"start": 362,
"end": 380,
"loc": {
"start": {
"line": 22,
"column": 7
},
"end": {
"line": 22,
"column": 25
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 368,
"end": 380,
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 25
}
},
"id": {
"type": "Identifier",
"start": 368,
"end": 380,
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 25
},
"identifierName": "animationKey"
},
"name": "animationKey"
},
"init": null
}
],
"kind": "const"
},
"right": {
"type": "Identifier",
"start": 384,
"end": 394,
"loc": {
"start": {
"line": 22,
"column": 29
},
"end": {
"line": 22,
"column": 39
},
"identifierName": "animations"
},
"name": "animations"
},
"body": {
"type": "BlockStatement",
"start": 396,
"end": 1338,
"loc": {
"start": {
"line": 22,
"column": 41
},
"end": {
"line": 50,
"column": 3
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 403,
"end": 446,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 23,
"column": 47
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 409,
"end": 445,
"loc": {
"start": {
"line": 23,
"column": 10
},
"end": {
"line": 23,
"column": 46
}
},
"id": {
"type": "Identifier",
"start": 409,
"end": 418,
"loc": {
"start": {
"line": 23,
"column": 10
},
"end": {
"line": 23,
"column": 19
},
"identifierName": "animation"
},
"name": "animation"
},
"init": {
"type": "MemberExpression",
"start": 421,
"end": 445,
"loc": {
"start": {
"line": 23,
"column": 22
},
"end": {
"line": 23,
"column": 46
}
},
"object": {
"type": "Identifier",
"start": 421,
"end": 431,
"loc": {
"start": {
"line": 23,
"column": 22
},
"end": {
"line": 23,
"column": 32
},
"identifierName": "animations"
},
"name": "animations"
},
"property": {
"type": "Identifier",
"start": 432,
"end": 444,
"loc": {
"start": {
"line": 23,
"column": 33
},
"end": {
"line": 23,
"column": 45
},
"identifierName": "animationKey"
},
"name": "animationKey"
},
"computed": true
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 452,
"end": 480,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 32
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 458,
"end": 479,
"loc": {
"start": {
"line": 24,
"column": 10
},
"end": {
"line": 24,
"column": 31
}
},
"id": {
"type": "ObjectPattern",
"start": 458,
"end": 467,
"loc": {
"start": {
"line": 24,
"column": 10
},
"end": {
"line": 24,
"column": 19
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 460,
"end": 465,
"loc": {
"start": {
"line": 24,
"column": 12
},
"end": {
"line": 24,
"column": 17
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 460,
"end": 465,
"loc": {
"start": {
"line": 24,
"column": 12
},
"end": {
"line": 24,
"column": 17
},
"identifierName": "bones"
},
"name": "bones"
},
"value": {
"type": "Identifier",
"start": 460,
"end": 465,
"loc": {
"start": {
"line": 24,
"column": 12
},
"end": {
"line": 24,
"column": 17
},
"identifierName": "bones"
},
"name": "bones"
},
"extra": {
"shorthand": true
}
}
]
},
"init": {
"type": "Identifier",
"start": 470,
"end": 479,
"loc": {
"start": {
"line": 24,
"column": 22
},
"end": {
"line": 24,
"column": 31
},
"identifierName": "animation"
},
"name": "animation"
}
}
],
"kind": "const"
},
{
"type": "IfStatement",
"start": 486,
"end": 1333,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 49,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 490,
"end": 497,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 15
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "UnaryExpression",
"start": 491,
"end": 497,
"loc": {
"start": {
"line": 25,
"column": 9
},
"end": {
"line": 25,
"column": 15
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 492,
"end": 497,
"loc": {
"start": {
"line": 25,
"column": 10
},
"end": {
"line": 25,
"column": 15
},
"identifierName": "bones"
},
"name": "bones"
},
"extra": {
"parenthesizedArgument": false
}
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 499,
"end": 1333,
"loc": {
"start": {
"line": 25,
"column": 17
},
"end": {
"line": 49,
"column": 5
}
},
"body": [
{
"type": "ForInStatement",
"start": 508,
"end": 1326,
"loc": {
"start": {
"line": 26,
"column": 6
},
"end": {
"line": 48,
"column": 7
}
},
"left": {
"type": "VariableDeclaration",
"start": 513,
"end": 526,
"loc": {
"start": {
"line": 26,
"column": 11
},
"end": {
"line": 26,
"column": 24
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 519,
"end": 526,
"loc": {
"start": {
"line": 26,
"column": 17
},
"end": {
"line": 26,
"column": 24
}
},
"id": {
"type": "Identifier",
"start": 519,
"end": 526,
"loc": {
"start": {
"line": 26,
"column": 17
},
"end": {
"line": 26,
"column": 24
},
"identifierName": "boneKey"
},
"name": "boneKey"
},
"init": null
}
],
"kind": "const"
},
"right": {
"type": "Identifier",
"start": 530,
"end": 535,
"loc": {
"start": {
"line": 26,
"column": 28
},
"end": {
"line": 26,
"column": 33
},
"identifierName": "bones"
},
"name": "bones"
},
"body": {
"type": "BlockStatement",
"start": 537,
"end": 1326,
"loc": {
"start": {
"line": 26,
"column": 35
},
"end": {
"line": 48,
"column": 7
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 548,
"end": 581,
"loc": {
"start": {
"line": 27,
"column": 8
},
"end": {
"line": 27,
"column": 41
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 554,
"end": 580,
"loc": {
"start": {
"line": 27,
"column": 14
},
"end": {
"line": 27,
"column": 40
}
},
"id": {
"type": "Identifier",
"start": 554,
"end": 563,
"loc": {
"start": {
"line": 27,
"column": 14
},
"end": {
"line": 27,
"column": 23
},
"identifierName": "timelines"
},
"name": "timelines"
},
"init": {
"type": "MemberExpression",
"start": 566,
"end": 580,
"loc": {
"start": {
"line": 27,
"column": 26
},
"end": {
"line": 27,
"column": 40
}
},
"object": {
"type": "Identifier",
"start": 566,
"end": 571,
"loc": {
"start": {
"line": 27,
"column": 26
},
"end": {
"line": 27,
"column": 31
},
"identifierName": "bones"
},
"name": "bones"
},
"property": {
"type": "Identifier",
"start": 572,
"end": 579,
"loc": {
"start": {
"line": 27,
"column": 32
},
"end": {
"line": 27,
"column": 39
},
"identifierName": "boneKey"
},
"name": "boneKey"
},
"computed": true
}
}
],
"kind": "const"
},
{
"type": "ForInStatement",
"start": 591,
"end": 1317,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 47,
"column": 9
}
},
"left": {
"type": "VariableDeclaration",
"start": 596,
"end": 613,
"loc": {
"start": {
"line": 28,
"column": 13
},
"end": {
"line": 28,
"column": 30
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 602,
"end": 613,
"loc": {
"start": {
"line": 28,
"column": 19
},
"end": {
"line": 28,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 602,
"end": 613,
"loc": {
"start": {
"line": 28,
"column": 19
},
"end": {
"line": 28,
"column": 30
},
"identifierName": "timelineKey"
},
"name": "timelineKey"
},
"init": null
}
],